-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing Kubernetes Resources without
GroupVersionKind
(#38956)
* Fix parsing Kubernetes Resources without `GroupVersionKind` Kubernetes API has a concept of `GroupVersionKind` where each payload includes the type identification `(group, version, kind)` that uniquely identifies the resource withing Kubernetes itself. Kubernetes API and `kubectl` always honor this information but custom tools and tools that use equivalents of `json.Marshal` without setting the `GVK` data fail to be decoded when decoding `CREATE` requests targeted to support kinds. This PR aims to fix that by providing an hint to the Kubernetes decoder that aims to be used as fallback GVK when unmarshaling a payload without the specification. The hint is provided by the API request path that Teleport extracts from the request URI. Fixes #37972 Signed-off-by: Tiago Silva <[email protected]> * handle review comments --------- Signed-off-by: Tiago Silva <[email protected]>
- Loading branch information
Showing
10 changed files
with
145 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.