Skip to content

Commit 6032cd1

Browse files
committed
test(marketplace): update cozystack-api RBAC unit test for the packages delete grant
The tap disconnect ClusterRole rule now also grants delete on Packages (to remove the tap-managed registration Package); update the helm-unittest assertion to match. Signed-off-by: IvanHunters <[email protected]>
1 parent f94c17d commit 6032cd1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/system/cozystack-api/tests/rbac_test.yaml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,17 @@ tests:
4545
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
4646

4747
# The marketplace tap flow: disconnecting a tap deletes its cluster-scoped
48-
# PackageSource, and the tap's Flux OCIRepository is read to report status.
49-
# Both grants live on this ClusterRole because the tap handler runs with the
50-
# cozystack-api ServiceAccount's client.
51-
- it: grants delete on cozystack.io packagesources for tap disconnect
48+
# PackageSource and the tap-managed registration Package that de-registers its
49+
# apps, and the tap's Flux OCIRepository is read to report status. These grants
50+
# live on this ClusterRole because the tap handler runs with the cozystack-api
51+
# ServiceAccount's client.
52+
- it: grants delete on cozystack.io packagesources and packages for tap disconnect
5253
asserts:
5354
- contains:
5455
path: rules
5556
content:
5657
apiGroups: ["cozystack.io"]
57-
resources: ["packagesources"]
58+
resources: ["packagesources", "packages"]
5859
verbs: ["delete"]
5960

6061
- it: grants read on source.toolkit.fluxcd.io ocirepositories for tap status

0 commit comments

Comments
 (0)