Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cluster/manifests/fabric-gateway/02-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: "fabricgateway-policy.zalando.org"
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: ["zalando.org"]
apiVersions: ["v1"]
operations: ["CREATE"]
resources: ["fabricgateways"]
validations:
- expression: 'object.spec.exists(key, key == "x-external-service-provider") && object.spec["x-external-service-provider"].exists(key, key == "stackVersion")'
Copy link
Member Author

Choose a reason for hiding this comment

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

has macro doesn't really work with this naming convention, that's why I used exists

message: "x-external-service-provider.stackVersion must be set if you are using FabricGateway with StackSet to enable FabricGateway versioning."
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: "fabricgateway-policy.zalando.org"
spec:
policyName: "fabricgateway-policy.zalando.org"
validationActions: [Deny]