[Multi_K8s-Plugin] Pin Is* methods to exact Kubernetes API groups#6784
Open
mohammedfirdouss wants to merge 2 commits into
Open
[Multi_K8s-Plugin] Pin Is* methods to exact Kubernetes API groups#6784mohammedfirdouss wants to merge 2 commits into
mohammedfirdouss wants to merge 2 commits into
Conversation
6597c80 to
4c9dbd4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6784 +/- ##
==========================================
+ Coverage 29.33% 35.76% +6.43%
==========================================
Files 598 96 -502
Lines 63902 8399 -55503
==========================================
- Hits 18744 3004 -15740
+ Misses 43711 5230 -38481
+ Partials 1447 165 -1282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… groups Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
a29ed60 to
f06031f
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does:
Tightens the API group checks in
provider/manifest.go. TheIs*methods previously usedisBuiltinAPIGroup()which accepted any of ~20 builtin Kubernetes API groups, a Deployment-like CRD from a non-appsgroup would passIsDeployment(). Each method is now pinned to its exact API group:IsDeployment,IsStatefulSet,IsDaemonSet,IsReplicaSet→ group must be"apps"IsService,IsSecret,IsConfigMap,IsPod→ group must be""(core)IsWorkload→ applies the per-Kind group rule aboveisBuiltinAPIGroupand thebuiltinAPIGroupsmap are now unused and have been removed.Why we need it:
The loose check could misidentify a custom resource with the same Kind string but a different API group as a known Kubernetes workload or service, causing incorrect variant label injection or cleanup behaviour.
Which issue(s) this PR fixes:
Fixes #6446
Does this PR introduce a user-facing change?:
Deploymentin a non-appsgroup) will no longer have that resource treated as a workload which is the correct behaviour.