Skip to content

Commit

Permalink
Set default, min, and max values on Webhook ports
Browse files Browse the repository at this point in the history
Problem: Operator Authors can create CSVs that define Webhooks with
containerPorts set outside the range of 1-65535, which prevents the
ValidatingWebhookConfiguration or MutatingWebhookConfiguration from
being created due to failed validation.

Solution: Update the CSV's CRD Validation to include the proper min and
max values for webhookDescription ContainerPort field. If the
containerPort is not defined, default to 443.
  • Loading branch information
awgreene committed Oct 27, 2020
1 parent 0e65642 commit 0369ef6
Show file tree
Hide file tree
Showing 14 changed files with 497 additions and 16 deletions.
Expand Up @@ -8704,6 +8704,9 @@ spec:
containerPort:
type: integer
format: int32
default: 443
maximum: 65535
minimum: 1
conversionCRDs:
type: array
items:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -23,7 +23,7 @@ require (
github.com/onsi/gomega v1.9.0
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
github.com/operator-framework/api v0.3.16
github.com/operator-framework/api v0.3.20
github.com/operator-framework/operator-registry v1.13.6
github.com/otiai10/copy v1.2.0
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -599,8 +599,8 @@ github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0 h1:kMiuiZXH1Gd
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0/go.mod h1:uUQ4LClRO+fg5MF/P6QxjMCb1C9f7Oh4RKepftDnEJE=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/api v0.3.16 h1:rMePhgntSMdU5mIifF78WaQa99oGR/RKQ4H6+Hrpv+o=
github.com/operator-framework/api v0.3.16/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/api v0.3.20 h1:2Ks8GXXl/H2sV9ll2iQBUO65ABQ5VuzN3IKEZCJWljo=
github.com/operator-framework/api v0.3.20/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
github.com/operator-framework/operator-registry v1.13.6 h1:h/dIjQQS7uneQNRifrSz7h0xg4Xyjg6C9f6XZofbMPg=
github.com/operator-framework/operator-registry v1.13.6/go.mod h1:YhnIzOVjRU2ZwZtzt+fjcjW8ujJaSFynBEu7QVKaSdU=
github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k=
Expand Down
3 changes: 3 additions & 0 deletions manifests/0000_50_olm_00-clusterserviceversions.crd.yaml
Expand Up @@ -8704,6 +8704,9 @@ spec:
containerPort:
type: integer
format: int32
default: 443
maximum: 65535
minimum: 1
conversionCRDs:
type: array
items:
Expand Down
201 changes: 201 additions & 0 deletions vendor/github.com/operator-framework/api/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions vendor/github.com/operator-framework/api/crds/zz_defs.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0369ef6

Please sign in to comment.