Skip to content

Commit

Permalink
Require rules field in APIRule CRD (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
colunira authored Nov 25, 2019
1 parent 40f0ce2 commit 295e8fc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/apiRule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type APIRuleSpec struct {
// Gateway to be used
// +kubebuilder:validation:Pattern=^(?:[_a-z0-9](?:[_a-z0-9-]+[a-z0-9])?\.)+(?:[a-z](?:[a-z0-9-]+[a-z0-9])?)?$
Gateway *string `json:"gateway"`
//Paths represents collection of Path to secure
//Rules represents collection of Rule to apply
// +kubebuilder:validation:MinItems=1
Rules []Rule `json:"rules,omitempty"`
Rules []Rule `json:"rules"`
}

// APIRuleStatus defines the observed state of ApiRule
Expand Down
3 changes: 2 additions & 1 deletion config/crd/bases/gateway.kyma-project.io_apirules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ spec:
pattern: ^(?:[_a-z0-9](?:[_a-z0-9-]+[a-z0-9])?\.)+(?:[a-z](?:[a-z0-9-]+[a-z0-9])?)?$
type: string
rules:
description: Paths represents collection of Path to secure
description: Rules represents collection of Rule to apply
items:
properties:
accessStrategies:
Expand Down Expand Up @@ -471,6 +471,7 @@ spec:
required:
- service
- gateway
- rules
type: object
status:
properties:
Expand Down
3 changes: 2 additions & 1 deletion install/helm/api-gateway/files/crd-apirules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ spec:
pattern: ^(?:[_a-z0-9](?:[_a-z0-9-]+[a-z0-9])?\.)+(?:[a-z](?:[a-z0-9-]+[a-z0-9])?)?$
type: string
rules:
description: Paths represents collection of Path to secure
description: Rules represents collection of Rule to apply
items:
properties:
accessStrategies:
Expand Down Expand Up @@ -471,6 +471,7 @@ spec:
required:
- service
- gateway
- rules
type: object
status:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spec:
this object.
type: string
required:
- name
- name
type: object
type: array
result:
Expand Down Expand Up @@ -263,7 +263,7 @@ spec:
type: string
type: object
required:
- pending
- pending
type: object
labels:
additionalProperties:
Expand Down Expand Up @@ -356,10 +356,10 @@ spec:
description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids'
type: string
required:
- apiVersion
- kind
- name
- uid
- apiVersion
- kind
- name
- uid
type: object
type: array
resourceVersion:
Expand Down Expand Up @@ -390,7 +390,7 @@ spec:
pattern: ^(?:[_a-z0-9](?:[_a-z0-9-]+[a-z0-9])?\.)+(?:[a-z](?:[a-z0-9-]+[a-z0-9])?)?$
type: string
rules:
description: Paths represents collection of Path to secure
description: Rules represents collection of Rule to apply
items:
properties:
accessStrategies:
Expand All @@ -405,7 +405,7 @@ spec:
description: Name is the name of a handler
type: string
required:
- handler
- handler
type: object
minItems: 1
type: array
Expand All @@ -426,16 +426,16 @@ spec:
description: Name is the name of a handler
type: string
required:
- handler
- handler
type: object
type: array
path:
description: Path to be exposed
pattern: ^/([0-9a-zA-Z./*]+)
type: string
required:
- path
- accessStrategies
- path
- accessStrategies
type: object
minItems: 1
type: array
Expand All @@ -462,13 +462,14 @@ spec:
minimum: 1
type: integer
required:
- name
- port
- host
- name
- port
- host
type: object
required:
- service
- gateway
- service
- gateway
- rules
type: object
status:
properties:
Expand Down Expand Up @@ -502,9 +503,9 @@ spec:
type: object
type: object
versions:
- name: v1alpha1
served: true
storage: true
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
Expand Down

0 comments on commit 295e8fc

Please sign in to comment.