Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix(appliance): resource kind present on reconciler logs#63919

Merged
craigfurman merged 1 commit into
mainfrom
appliance-resource-type-meta
Jul 18, 2024
Merged

fix(appliance): resource kind present on reconciler logs#63919
craigfurman merged 1 commit into
mainfrom
appliance-resource-type-meta

Conversation

@craigfurman

@craigfurman craigfurman commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

It turns out that Kubernetes objects constructed using client-go don't know their own TypeMeta. There is code in client-go that figures out which resource-scoped HTTP path to call on the kube-apiserver by looking up a mapping of Go object kinds to k8s kinds. A similar facility appears to be exposed to the user by apiutil.GVKForObject().

Closes https://linear.app/sourcegraph/issue/REL-275/reconciler-logs-dont-contain-resource-metadata

Test plan

Ran go test -v ./internal/appliance/reconciler, saw kinds present in logs.

Changelog

It turns out that Kubernetes objects constructed using client-go don't
know their own TypeMeta. There is code in client-go that figures out
which resource-scoped HTTP path to call on the kube-apiserver by looking
up a mapping of Go object kinds to k8s kinds. A similar facility appears
to be exposed to the user by apiutil.GVKForObject().

Closes
https://linear.app/sourcegraph/issue/REL-275/reconciler-logs-dont-contain-resource-metadata.
@craigfurman craigfurman added the no-changelog Exclude this PR from the next changelog. label Jul 18, 2024
@craigfurman craigfurman requested review from a team and jdpleiness and removed request for a team July 18, 2024 15:05
@cla-bot cla-bot Bot added the cla-signed label Jul 18, 2024
@craigfurman craigfurman enabled auto-merge (squash) July 18, 2024 15:39

@jdpleiness jdpleiness left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went over this in 🍐 'ing.

@craigfurman craigfurman merged commit 0491839 into main Jul 18, 2024
@craigfurman craigfurman deleted the appliance-resource-type-meta branch July 18, 2024 17:29
craigfurman pushed a commit that referenced this pull request Jul 31, 2024
It turns out that Kubernetes objects constructed using client-go don't
know their own TypeMeta. There is code in client-go that figures out
which resource-scoped HTTP path to call on the kube-apiserver by looking
up a mapping of Go object kinds to k8s kinds. A similar facility appears
to be exposed to the user by apiutil.GVKForObject().

Closes
https://linear.app/sourcegraph/issue/REL-275/reconciler-logs-dont-contain-resource-metadata
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed no-changelog Exclude this PR from the next changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants