Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] Fix parsing Kubernetes Resources without GroupVersionKind #39168

Merged
merged 2 commits into from Mar 11, 2024

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented Mar 10, 2024

Backport #38956 to branch/v15

changelog: Resolved sporadic errors caused by requests fail to comply with Kubernetes API spec by not specifying resource identifiers.

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 <tiago.silva@goteleport.com>
@tigrato tigrato added this pull request to the merge queue Mar 11, 2024
Merged via the queue into branch/v15 with commit 9e6f519 Mar 11, 2024
34 checks passed
@tigrato tigrato deleted the bot/backport-38956-branch/v15 branch March 11, 2024 01:22
@fheinecke fheinecke mentioned this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants