Summary
Currently stripNamespacePrefix (added in #2671) discards the [namespace] prefix from artifact references before executor scope matching. The namespace information is not used by the v2 executor at all.
Background
Gatekeeper constraint templates encode namespace into the image key: [default]registry:5000/notation:signed. The v2 executor strips this prefix to do scope matching, but throws away the namespace value.
In v1, namespace was used to select namespaced CRDs (NamespacedVerifier, NamespacedKeyManagementProvider, etc.). In v2, executors are cluster-scoped and namespace is ignored.
Proposal
- Change
stripNamespacePrefix to parseArtifactKey that returns (namespace, artifact) instead of just the stripped artifact
- Pass namespace into
matchExecutor for namespace-aware filtering
- Support namespace-scoped Executor CRDs, allowing different executor configurations per namespace
- Consider extending the key format to
[namespace|executor]image for explicit executor selection (avoids O(N×M) when multiple constraint templates and executors target the same image)
Related
Summary
Currently
stripNamespacePrefix(added in #2671) discards the[namespace]prefix from artifact references before executor scope matching. The namespace information is not used by the v2 executor at all.Background
Gatekeeper constraint templates encode namespace into the image key:
[default]registry:5000/notation:signed. The v2 executor strips this prefix to do scope matching, but throws away the namespace value.In v1, namespace was used to select namespaced CRDs (NamespacedVerifier, NamespacedKeyManagementProvider, etc.). In v2, executors are cluster-scoped and namespace is ignored.
Proposal
stripNamespacePrefixtoparseArtifactKeythat returns(namespace, artifact)instead of just the stripped artifactmatchExecutorfor namespace-aware filtering[namespace|executor]imagefor explicit executor selection (avoids O(N×M) when multiple constraint templates and executors target the same image)Related
stripNamespacePrefiximplementationisSuccess→succeeded)