Skip to content

Commit

Permalink
Fix bug in response validation rules (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-cattermole authored Nov 2, 2023
1 parent fbe0c44 commit bb6476e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions api/v1beta2/authpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ type CallbackSpec struct {
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.authentication) || !self.rules.authentication.exists(x, has(self.rules.authentication[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.metadata) || !self.rules.metadata.exists(x, has(self.rules.metadata[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.authorization) || !self.rules.authorization.exists(x, has(self.rules.authorization[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.response) || !has(self.rules.response.success) || self.rules.response.success.headers.exists(x, has(self.rules.response.success.headers[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.response) || !has(self.rules.response.success) || self.rules.response.success.dynamicMetadata.exists(x, has(self.rules.response.success.dynamicMetadata[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.response) || !has(self.rules.response.success) || !has(self.rules.response.success.headers) || !self.rules.response.success.headers.exists(x, has(self.rules.response.success.headers[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.response) || !has(self.rules.response.success) || !has(self.rules.response.success.dynamicMetadata) || !self.rules.response.success.dynamicMetadata.exists(x, has(self.rules.response.success.dynamicMetadata[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.rules.callbacks) || !self.rules.callbacks.exists(x, has(self.rules.callbacks[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
type AuthPolicySpec struct {
// TargetRef identifies an API object to apply policy to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
containerImage: quay.io/kuadrant/kuadrant-operator:latest
createdAt: "2023-10-20T10:46:36Z"
createdAt: "2023-11-02T12:36:24Z"
operators.operatorframework.io/builder: operator-sdk-v1.28.1
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/Kuadrant/kuadrant-operator
Expand Down
8 changes: 4 additions & 4 deletions bundle/manifests/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4197,12 +4197,12 @@ spec:
|| !self.rules.authorization.exists(x, has(self.rules.authorization[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.response)
|| !has(self.rules.response.success) || self.rules.response.success.headers.exists(x,
has(self.rules.response.success.headers[x].routeSelectors))
|| !has(self.rules.response.success) || !has(self.rules.response.success.headers)
|| !self.rules.response.success.headers.exists(x, has(self.rules.response.success.headers[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.response)
|| !has(self.rules.response.success) || self.rules.response.success.dynamicMetadata.exists(x,
has(self.rules.response.success.dynamicMetadata[x].routeSelectors))
|| !has(self.rules.response.success) || !has(self.rules.response.success.dynamicMetadata)
|| !self.rules.response.success.dynamicMetadata.exists(x, has(self.rules.response.success.dynamicMetadata[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.callbacks)
|| !self.rules.callbacks.exists(x, has(self.rules.callbacks[x].routeSelectors))
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4196,12 +4196,12 @@ spec:
|| !self.rules.authorization.exists(x, has(self.rules.authorization[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.response)
|| !has(self.rules.response.success) || self.rules.response.success.headers.exists(x,
has(self.rules.response.success.headers[x].routeSelectors))
|| !has(self.rules.response.success) || !has(self.rules.response.success.headers)
|| !self.rules.response.success.headers.exists(x, has(self.rules.response.success.headers[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.response)
|| !has(self.rules.response.success) || self.rules.response.success.dynamicMetadata.exists(x,
has(self.rules.response.success.dynamicMetadata[x].routeSelectors))
|| !has(self.rules.response.success) || !has(self.rules.response.success.dynamicMetadata)
|| !self.rules.response.success.dynamicMetadata.exists(x, has(self.rules.response.success.dynamicMetadata[x].routeSelectors))
- message: route selectors not supported when targeting a Gateway
rule: self.targetRef.kind != 'Gateway' || !has(self.rules.callbacks)
|| !self.rules.callbacks.exists(x, has(self.rules.callbacks[x].routeSelectors))
Expand Down

0 comments on commit bb6476e

Please sign in to comment.