Skip to content

[Multi_K8s-Plugin] Pin Is* methods to exact Kubernetes API groups#6784

Open
mohammedfirdouss wants to merge 2 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-api-group-checks-clean
Open

[Multi_K8s-Plugin] Pin Is* methods to exact Kubernetes API groups#6784
mohammedfirdouss wants to merge 2 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-api-group-checks-clean

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

@mohammedfirdouss mohammedfirdouss commented May 17, 2026

What this PR does:
Tightens the API group checks in provider/manifest.go. The Is* methods previously used isBuiltinAPIGroup() which accepted any of ~20 builtin Kubernetes API groups, a Deployment-like CRD from a non-apps group would pass IsDeployment(). 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 above

isBuiltinAPIGroup and the builtinAPIGroups map 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?:

  • How are users affected by this change: No change for standard Kubernetes resources. Users with CRDs that share a Kind name with a builtin resource (e.g. a CRD named Deployment in a non-apps group) will no longer have that resource treated as a workload which is the correct behaviour.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.76%. Comparing base (5df1ef3) to head (4c9dbd4).

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     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis 32.43% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs 31.82% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 37.95% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval 52.71% <ø> (ø)
.-pkg-plugin-sdk 50.34% <ø> (ø)
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… groups

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/fix-api-group-checks-clean branch from a29ed60 to f06031f Compare May 17, 2026 08:05
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.

[LFX Mentorship T-1 2026] Kubernetes Multi-Cluster Plugin #6446

1 participant