kubernetes/pkg/apis/networking
Miciah Masters e648deca3b Fix validation of ingress rules with wildcard host
Fix ingress validation so that it validates the rules of an ingress that
specifies a wildcard host.  Commit 60f4fbf4f2
added an inopportune continue statement that caused this validation to be
skipped.  For backwards compatibility, this change restores validation for
v1 of the api but still skips it on v1beta1.

* pkg/apis/networking/validation/validation.go (IngressValidationOptions):
Add AllowInvalidWildcardHostRule field to indicate that validation of rules
should be skipped for ingresses that specify wildcard hosts.
(ValidateIngressCreate): Set AllowInvalidWildcardHostRule to true if the
request is using the v1beta1 API version.
(ValidateIngressUpdate): Set AllowInvalidWildcardHostRule to true if the
request or old ingress is using the v1beta1 API version.
(validateIngressRules): Don't skip validation of the ingress rules unless
the ingress has a wildcard host and AllowInvalidWildcardHostRule is true.
(allowInvalidWildcardHostRule): New helper for ValidateIngressCreate and
ValidateIngressUpdate.
* pkg/apis/networking/validation/validation_test.go
(TestValidateIngressCreate, TestValidateIngressUpdate): Add test cases to
ensure that validation is performed on v1 objects and skipped on v1beta
objects for backwards compatibility.
(TestValidateIngressTLS): Specify PathType so that the test passes.

Co-authored-by: jordan@liggitt.net
2020-08-13 15:53:17 -04:00
..
fuzzer ingress: Add Ingress to v1 API and update backend to defaultBackend 2020-05-22 11:57:41 -04:00
install generated files 2019-02-20 23:32:46 -05:00
v1 ingress: Add Ingress to v1 API and update backend to defaultBackend 2020-05-22 11:57:41 -04:00
v1beta1 ingress: Add Ingress to v1 API and update backend to defaultBackend 2020-05-22 11:57:41 -04:00
validation Fix validation of ingress rules with wildcard host 2020-08-13 15:53:17 -04:00
BUILD generated files 2019-02-20 23:32:46 -05:00
doc.go *: Remove comment tags in GoDoc 2018-09-13 20:27:32 -07:00
OWNERS organize sig-net-api-{reviewers,approvers} in OWNERS_ALIASES 2019-05-06 12:04:04 -04:00
register.go Adding IngressClass to networking/v1beta1 2020-03-01 18:17:09 -08:00
types.go ingress: Add Ingress to v1 API and update backend to defaultBackend 2020-05-22 11:57:41 -04:00
zz_generated.deepcopy.go ingress: Add Ingress to v1 API and update backend to defaultBackend 2020-05-22 11:57:41 -04:00