Skip to content

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

Merged
Warashi merged 4 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-api-group-checks-clean
May 24, 2026
Merged

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

Conversation

@mohammedfirdouss

@mohammedfirdouss mohammedfirdouss commented May 17, 2026

Copy link
Copy Markdown
Contributor

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

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.65%. Comparing base (215ea40) to head (3dec18e).

Files with missing lines Patch % Lines
...lugin/kubernetes_multicluster/provider/manifest.go 36.36% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6784       +/-   ##
===========================================
+ Coverage   29.33%   56.65%   +27.32%     
===========================================
  Files         598       99      -499     
  Lines       63902    10496    -53406     
===========================================
- Hits        18744     5947    -12797     
+ Misses      43711     4115    -39596     
+ Partials     1447      434     -1013     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis ?
.-pkg-app-pipedv1-plugin-ecs ?
.-pkg-app-pipedv1-plugin-kubernetes 58.37% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 61.66% <36.36%> (-0.24%) ⬇️
.-pkg-app-pipedv1-plugin-scriptrun ?
.-pkg-app-pipedv1-plugin-terraform 37.95% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval ?
.-pkg-plugin-sdk 50.14% <ø> (-0.20%) ⬇️
.-tool-actions-gh-release ?
.-tool-actions-plan-preview ?
.-tool-codegen-protoc-gen-auth ?

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

@Warashi Warashi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for late, LGTM

@Warashi Warashi merged commit 2a14ddf into pipe-cd:master May 24, 2026
45 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD! The changes in this pull request will be part of the upcoming release!

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

2 participants