Files
cozystack/packages/system/cozystack-controller/templates/tap-source-role.yaml
T
IvanHunters b6f14373b5 fix(marketplace): scope controller OCIRepository writes and split validate YAML safely
Close the two non-blocking notes from the latest review, mirroring fixes already
applied on the other side:
- The tap materializer's update/patch on ocirepositories moves from the
  cluster-wide cozystack-controller ClusterRole to a namespaced Role in
  cozy-system (get/list/watch stay cluster-wide for the informer), matching the
  API-side scoping. The materializer only ever writes tap sources in cozy-system.
- cozypkg validate now splits multi-document YAML with the apimachinery reader
  instead of a naive ^---$ regex, so a PackageSource whose block scalar contains
  a separator-looking line is not fractured — the gate's validator now decodes
  the same content the materializer applies. Covered by a block-scalar test.

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-09-07 10:58:38 +03:00

29 lines
914 B
YAML

# The tap materializer updates a community tap's OCIRepository (its finalizer and
# materialized-revision annotation), but only ever in cozy-system. Keep those
# write verbs in a namespaced Role here rather than granting them cluster-wide;
# get/list/watch stay cluster-wide (the catch-all rule in rbac.yaml) for the
# controller-runtime informer.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cozystack-controller-tap-sources
namespace: cozy-system
rules:
- apiGroups: ["source.toolkit.fluxcd.io"]
resources: ["ocirepositories"]
verbs: ["update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cozystack-controller-tap-sources
namespace: cozy-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cozystack-controller-tap-sources
subjects:
- kind: ServiceAccount
name: cozystack-controller
namespace: cozy-system