[KGLOBAL-6770] Add cluster-link namespace to rbac role commands#3359
[KGLOBAL-6770] Add cluster-link namespace to rbac role commands#3359Yuan (yhe-confluent) wants to merge 4 commits into
Conversation
Expose ClusterLink RBAC roles (e.g. ClusterLinkConnection) in `confluent iam rbac role list` and `role describe` by adding the `cluster-link` namespace to the CCloud allowlist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR extends the Confluent Cloud RBAC role commands to include the cluster-link namespace so Cluster Link RBAC roles can be surfaced by confluent iam rbac role list and confluent iam rbac role describe.
Changes:
- Added
cluster-linkto the namespace allowlist used by RBAC role describe. - Added an additional namespace fetch in RBAC role list for
cluster-link. - Updated the cloud golden output fixture to reflect the additional namespace fetch.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/iam/command_rbac.go |
Adds clusterLinkNamespace constant for reuse across RBAC commands. |
internal/iam/command_rbac_role_list.go |
Fetches and appends roles from the cluster-link namespace during cloud role listing. |
internal/iam/command_rbac_role_describe.go |
Includes cluster-link in the set of namespaces searched for role details in cloud mode. |
test/fixtures/output/iam/rbac/role/list-cloud.golden |
Updates expected output for iam rbac role list in cloud tests after adding a third namespace fetch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…r-link namespace Addresses Copilot review feedback: previously the mock returned the same public roles regardless of ?namespace=, so the golden could not validate that the cluster-link namespace returns a distinct role. Now `HandleAllRolesRoute` dispatches on the `namespace` query parameter and returns `ClusterLinkConnection` (the role this PR exposes) for `cluster-link`. The golden now asserts that `ClusterLinkConnection` appears once. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Daniel Ayaz (danielayaz)
left a comment
There was a problem hiding this comment.
Looks good; just need the manual verification done and I can approve
|
Daniel Ayaz (@danielayaz) manual verification done — captured against
Both checklist items now ticked: "successfully built and used a custom CLI binary" + "verified in Confluent Cloud pre-prod" + "attached manual CLI verification results". Ready for your approval whenever you have a minute. |
Cynthia Qin (cqin-confluent)
left a comment
There was a problem hiding this comment.
LGTM 👍 Let’s hold off on merging for now while we align on the rollout plan.
Gate the cluster-link namespace in `confluent iam rbac role list` and `role describe` behind the `cluster.link.rbac.namespace.cli.enable` LaunchDarkly flag (default false), mirroring the Flink RBAC namespace gating in describe. This keeps ClusterLink roles hidden in stag/prod where the ClusterLink resource type is not yet deployed, while allowing rollout via the flag (enabled in devel today). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Release Notes
New Features
cluster-linknamespace toconfluent iam rbac role listandconfluent iam rbac role describe, so ClusterLink RBAC roles (e.g.ClusterLinkConnection) are listed and described in Confluent Cloud.cluster.link.rbac.namespace.cli.enable(defaultfalse) that gates thecluster-linknamespace. The roles stay hidden until the flag is enabled per environment.Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Applies to: Confluent Cloud only.
Adds the
cluster-linknamespace to the CCloud allowlist forconfluent iam rbac role listandconfluent iam rbac role describe, so customers can discover and describe ClusterLink RBAC roles via the CLI.The namespace is defined in
cc-role-definitions:role-definitions/src/main/resources/role-definitions/ClusterLinkConnection.yamlhasnamespace: cluster-link.The namespace addition mirrors #3186 (which added the
usmnamespace), and the new flag gating mirrors how the Flink RBAC namespaces are gated inrole describe(flink.rbac.namespace.cli.enable):internal/iam/command_rbac.go— declareclusterLinkNamespaceinternal/iam/command_rbac_role_describe.go— appendcluster-linktonamespacesListwhencluster.link.rbac.namespace.cli.enableis enabledinternal/iam/command_rbac_role_list.go— fetch and append cluster-link roles inccloudListwhen the flag is enabledtest/test-server/ccloud_handlers.go— mock LD response returns the flag enabled so integration goldens exercise the on pathThe new LaunchDarkly flag
cluster.link.rbac.namespace.cli.enablelives in thedefault(Confluent Cloud) LD project, defaults tofalse, and is currently enabled in devel only (off in stag/prod) — keeping ClusterLink roles hidden where theClusterLinkresource type is not yet deployed.Phase 1 of the Cluster Link RBAC project: source-initiated cluster link service account authorization. Companion UI change in
confluentinc/frontend-vault(#26611).Blast Radius
Minimal. Strictly additive and gated behind a LaunchDarkly flag that defaults to
false, so there is no customer-visible change until the flag is enabled per environment. When enabled, the change adds one extra namespace fetch to two CCloud-only commands. Worst case ifcc-rbacreturns an error for thecluster-linknamespace query, the command would fail with that error instead of returning the rest of the roles. Existing namespaces (public,usm,dataplane, etc.) are unaffected.References
flink.rbac.namespace.cli.enable)cluster.link.rbac.namespace.cli.enable(projectdefault)Test & Review
Integration tests
TestCLI/TestIamRbacRole_Cloud/iam_rbac_role_list— passTestCLI/TestIamRbacRole_Cloud/iam_rbac_role_describe_*— passTestCLI/TestIamRbacRole_OnPrem— passtest/fixtures/output/iam/rbac/role/list-cloud.goldenupdated via-update. The mock test server is now namespace-aware: returns a distinctClusterLinkConnectionrole only when?namespace=cluster-linkis requested (addresses Copilot's review feedback on test fidelity).Manual verification — devel environment
Verified against
devel.cpdev.cloud(the environment wherecc-role-definitions v8.3.0-57definingClusterLinkConnectionin thecluster-linknamespace is deployed).Before (stable CLI
v4.34.0, Git Ref3911a5b0— nocluster-linknamespace queried):After (custom binary built from this branch at commit
bb89541b):Both behaviors match expectations: the role is invisible to the stable CLI (no
cluster-linknamespace queried) and fully visible to the custom binary (queriescluster-linkand surfaces the role).