[1.14][identitygc] Bugfix: Pass shared EnableMetrics into GC struct #32447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Fixes: <commit-id>
tag, thenplease add the commit author[s] as reviewer[s] to this issue.
This is a 1.14 specific bug as on 1.15 and above there is #28166. 1.14 shipped with #22892 and it appears this got missed.
Currently when you run the operator with
--enable-metrics
that arg gets plumbed into SharedCfg but we never passed it into theGC
struct. As a result metrics like https://github.com/cilium/cilium/blob/v1.14/operator/identitygc/kvstore_gc.go#L73-L79 aren't getting emitted on 1.14 as they are checking against GC not the SharedCfg. This changes ensures that we pass through thep.SharedCfg.EnableMetrics
parameter to allow the conditional logic to work as expected.I've tested this on a local 1.14 cluster and configured that with this change the metrics (i.e.
cilium_operator_identity_gc_entries
andcilium_operator_identity_gc_runs
_ are once again emitted during identity GC.