-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(customresourcestate): log when configured CRD is not installed in cluster #2903
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -191,6 +191,8 @@ func FromConfig(decoder ConfigDecoder, discovererInstance *discovery.CRDiscovere | |||||
| resolvedSet /* GVKPs */, err := discovererInstance.ResolveGVKToGVKPs(schema.GroupVersionKind(resource.GroupVersionKind)) | ||||||
| if err != nil { | ||||||
| klog.ErrorS(err, "failed to resolve GVK", "gvk", resource.GroupVersionKind) | ||||||
| } else if len(resolvedSet) == 0 { | ||||||
| klog.InfoS("CRD for resource is not installed in the cluster, skipping", "gvk", resource.GroupVersionKind) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How often does this log? Only at the start up of ksm or regularly?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The log fires once per CRD informer event (add/update/delete), not on every poll tick.
|
||||||
| klog.InfoS("CRD for resource is not installed in the cluster, skipping", "gvk", resource.GroupVersionKind) | |
| klog.InfoS("no matching CRD found for configured GVK, skipping", "gvk", resource.GroupVersionKind) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maksimp13 can you address this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me — adding visibility for silently skipped CRDs is a nice improvement.
One note: this PR adds a log line, but issue #2354 reports that /metrics goes down entirely when non-existent CRDs are listed. A log doesn't fix that behavior, so Fixes #2354 might be inaccurate.
Consider changing it to Ref #2354 unless the endpoint issue has already been resolved separately.
/cc @rexagod
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I wasn't able to reproduce the /metrics crash locally - it seems it was already fixed in a previous versions. The endpoint returns 200 OK even when a configured CRD is not installed in the cluster.
Updated Fixes #2354 → Ref #2354.