Skip to content

feat(plugins): flux helm releases for OIDC clusters via ObjectLevelWorkloadIdentity - #2201

Open
mikolajkucinski wants to merge 10 commits into
mainfrom
feat/1637-plugin-object-level-workload-identity
Open

feat(plugins): flux helm releases for OIDC clusters via ObjectLevelWorkloadIdentity#2201
mikolajkucinski wants to merge 10 commits into
mainfrom
feat/1637-plugin-object-level-workload-identity

Conversation

@mikolajkucinski

@mikolajkucinski mikolajkucinski commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

#2192 made the bootstrap controller write a ConfigMap describing how to reach an OIDC onboarded cluster. This one makes Plugins use it. The HelmRelease points at that ConfigMap with configMapRef instead of the kubeconfig Secret, and helm templating builds its client the same way through NewRestClientGetterForWI, so helm-controller and the Plugin controller each mint their own token and there is nothing left to rotate.

Which path a Plugin takes follows the workloadIdentity feature gate and the cluster connectivity annotation, so the Plugin controller no longer probes for the ConfigMap and falls back. Clusters onboarded with a kubeconfig keep the Secret either way, and with the gate off nothing changes at all.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@mikolajkucinski
mikolajkucinski requested a review from a team as a code owner September 8, 2026 08:29
@abhijith-darshan
abhijith-darshan force-pushed the feat/1637-object-level-workload-identity branch 3 times, most recently from e6d971c to eab1e74 Compare September 9, 2026 09:09
Base automatically changed from feat/1637-object-level-workload-identity to main September 9, 2026 14:12
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
Add configMapRef selection for OIDC clusters, a fallback to the kubeconfig
Secret while the ConfigMap is missing, and an e2e for the emitted reference.

On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
Enable the feature gate on helm-controller in the flux install used by
dev-env and e2e, and assert the release installs through the access
ConfigMap instead of only checking the reference Greenhouse emits.

On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
…cluster access

On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
Copilot AI lite review requested due to automatic review settings September 9, 2026 14:37
@mikolajkucinski
mikolajkucinski force-pushed the feat/1637-plugin-object-level-workload-identity branch from 4dc156c to 9e66b6b Compare September 9, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are confirmed logic/config wiring issues that can break workload identity behavior (bootstrap feature flags config not passed; HelmRelease can reference a missing ConfigMap).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Enables Plugins (Flux HelmReleases) to target OIDC-onboarded clusters via Flux’s ObjectLevelWorkloadIdentity by switching from kubeconfig Secrets to a workload-identity ConfigMap reference, and adds E2E coverage for the end-to-end OIDC onboarding + install path.

Changes:

  • Add HelmRelease builder support for kubeConfig.configMapRef and corresponding unit tests.
  • Update Plugin controller logic to use workload identity (and mint SA tokens) when the feature flag is enabled and the target Cluster is OIDC.
  • Add an E2E scenario validating HelmRelease connectivity through the workload identity ConfigMap, plus suite wiring.
File summaries
File Description
internal/flux/helm_release_builder.go Adds WithKubeConfigFromConfigMap to build HelmRelease specs targeting OIDC clusters via ConfigMap.
internal/flux/helm_release_builder_test.go Unit tests for the new ConfigMap-based kubeConfig behavior.
internal/controller/plugin/util.go Chooses REST client getter based on WI feature flag + OIDC annotation (TokenRequest vs kubeconfig Secret).
internal/controller/plugin/plugin_controller.go Adds WI feature flag field and RBAC for TokenRequest creation.
internal/controller/plugin/plugin_controller_flux.go Switches HelmRelease creation to use configMapRef for OIDC clusters (gated by WI flag).
internal/controller/plugin/oci_mirror.go Uses WI-aware initClientGetter when initializing remote access for OCI mirroring logic.
e2e/plugin/scenarios/flux_object_level_workload_identity.go New E2E scenario covering OIDC onboarding → ConfigMap render → HelmRelease uses configMapRef and becomes Ready.
e2e/plugin/e2e_test.go Adds OIDC cluster name, cleanup, and registers the new scenario.
cmd/greenhouse/controllers.go Wires WI feature flag into Plugin reconciler startup; adjusts Bootstrap reconciler wiring.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 127 to 130
func startBootstrapReconciler(name string, mgr ctrl.Manager) error {
return (&clustercontrollers.BootstrapReconciler{
WorkloadIdentityEnabled: featureFlags.IsWorkloadIdentityEnabled(),
FeatureFlagsName: clientutil.GetEnvOrDefault(featureFlagsEnv, defaultFeatureFlagConfigMapName),
FeatureFlagsNamespace: clientutil.GetEnvOrDefault(podNamespaceEnv, defaultPodNamespace),
}).SetupWithManager(name, mgr)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed

Comment thread internal/controller/plugin/plugin_controller_flux.go
…onciler

On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>

@abhijith-darshan abhijith-darshan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@abhijith-darshan abhijith-darshan changed the title feat(plugins): reach OIDC clusters via ObjectLevelWorkloadIdentity feat(plugins): flux helm releases for OIDC clusters via ObjectLevelWorkloadIdentity Sep 10, 2026
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.

3 participants