Skip to content

Commit

Permalink
deployment: add validation to enforce delegations is a list of objects
Browse files Browse the repository at this point in the history
Fixes projectcontour#977

Also correct documentation that incorrectly stated that spec.delegations
was a singular key.

Signed-off-by: Dave Cheney <[email protected]>
  • Loading branch information
davecheney committed Apr 5, 2019
1 parent de46617 commit 168f668
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
17 changes: 17 additions & 0 deletions deployment/common/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,21 @@ spec:
names:
plural: tlscertificatedelegations
kind: TLSCertificateDelegation
validation:
openAPIV3Schema:
properties:
spec:
properties:
delegations:
type: array
items:
type: object
required:
- secretName
- targetNamespaces
properties:
match:
type: string
targetNamespaces:
type: array
---
17 changes: 17 additions & 0 deletions deployment/render/daemonset-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,23 @@ spec:
names:
plural: tlscertificatedelegations
kind: TLSCertificateDelegation
validation:
openAPIV3Schema:
properties:
spec:
properties:
delegations:
type: array
items:
type: object
required:
- secretName
- targetNamespaces
properties:
match:
type: string
targetNamespaces:
type: array
---
apiVersion: extensions/v1beta1
kind: DaemonSet
Expand Down
17 changes: 17 additions & 0 deletions deployment/render/deployment-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,23 @@ spec:
names:
plural: tlscertificatedelegations
kind: TLSCertificateDelegation
validation:
openAPIV3Schema:
properties:
spec:
properties:
delegations:
type: array
items:
type: object
required:
- secretName
- targetNamespaces
properties:
match:
type: string
targetNamespaces:
type: array
---
apiVersion: extensions/v1beta1
kind: Deployment
Expand Down
6 changes: 3 additions & 3 deletions docs/ingressroute.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ metadata:
namespace: www-admin
spec:
delegations:
secretName: example-com-wildcard
targetNamespaces:
- example-com
- secretName: example-com-wildcard
targetNamespaces:
- example-com
---
apiVersion: contour.heptio.com/v1beta1
kind: IngressRoute
Expand Down

0 comments on commit 168f668

Please sign in to comment.