Commit Graph

42 Commits

Author SHA1 Message Date
Daniela Lins
cb48e3cfca Handle int and string port in makePort
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-25 16:35:23 +01:00
Daniela Lins
853d2a6a0a Delete not used tweak
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-08 15:03:12 +01:00
Daniela Lins
36e040f86e Fix empty setter logic
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-07 13:13:09 +01:00
Daniela Lins
0444bdc944 Remove success case comments
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-06 19:18:19 +01:00
Daniela Lins
f8e7d30e46 Make tweaks only reset slices if empty
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-06 18:58:33 +01:00
Daniela Lins
6d330d9738 Refactored setIngressPorts and setEgressPorts
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-03-06 16:51:35 +01:00
Daniela Lins
611f061c45 Change error msg and comments to easily find test
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-24 13:09:13 +01:00
Daniela Lins
f7482a6766 Went through the review notes
- Adapt tweaks to be clearer
- Use intstr.fromInt and intstr.fromStr
- Added more tests to invalid ports

Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-21 12:22:17 +01:00
Daniela Lins
c9a5bf14d8 Fixed gofmt issues
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-18 10:02:27 +01:00
Daniela Lins
8572c973d8 Add IPV6 IPBlock to success cases
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-17 23:02:57 +01:00
Daniela Lins
77da0540e6 Add tweaks and use them to build error structs
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-16 19:46:35 +01:00
Daniela Lins
50d93d989f Add tweaking functions to TestValidateNetworkPolicy
Signed-off-by: Daniela Lins <danielamlins@gmail.com>
2021-02-13 17:57:04 +01:00
Carlos Panato
e57ea32158
networking/validation: add endport range validation 2021-02-04 10:28:26 +01:00
Ricardo Katz
b7c82bb83c
Add EndPort to Network Policy - Alpha (#97058)
* Fix merge conflict in kube_features

* Add alpha support for EndPort in Network Policy

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Add alpha support for EndPort in Network Policy

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Add alpha support for EndPort in Network Policy

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Correct some nits

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Add alpha support for EndPort in Network Policy

* Add alpha support for EndPort in Network Policy

* Add alpha support for EndPort in Network Policy

* Add alpha support for EndPort in Network Policy
2021-02-01 19:24:28 -08:00
Dan Winship
3a110546ed Move SCTP to GA 2020-10-15 08:56:33 -04:00
Matthew Fenwick
d407129cf7 modify DNS-1123 error messages to indicate that RFC 1123 is not followed exactly 2020-09-02 08:04:04 -04:00
Kubernetes Prow Robot
008708d036
Merge pull request #93966 from Miciah/verify-that-an-ingress-with-empty-TLS-is-valid
Verify that an ingress with empty TLS is valid
2020-08-27 04:48:57 -07:00
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
Miciah Masters
7ef8fa7207 Verify that an ingress with empty TLS is valid
Add a test that verifies that an ingress with an empty TLS value or with a
TLS value that specifies an empty list of hosts passes validation.

* pkg/apis/networking/validation/validation_test.go
(TestValidateEmptyIngressTLS): New test.
2020-08-13 11:55:18 -04:00
Jordan Liggitt
f87a846e65 Validate ingress TLS secretName in v1 2020-08-12 10:13:08 -04:00
Christopher M. Luciano
2b091f60ca
ingress: Add Ingress to v1 API and update backend to defaultBackend
ingress: use new serviceBackend split

ingress: remove all v1beta1 restrictions on creation

This change removes creation and update restrictions enforced by
k8s 1.18 for not allowing resource backends.

Paths are no longer
required to be valid regex and a PathType is now user-specified
and no longer defaulted.

Also remove all TODOs in staging/net/v1 types

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-05-22 11:57:41 -04:00
Jordan Liggitt
1758d17689 Allow resource backends in Ingress 2020-05-12 15:38:19 -04:00
Jordan Liggitt
8f7b8105a1 Remove ingress regex path requirement 2020-05-12 15:38:15 -04:00
Christopher M. Luciano
912f05bafb
ingress: add alternate resource backend
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-05 16:08:44 -05:00
Christopher M. Luciano
e931e30647
ingress: allow wildcard hosts in IngressRule
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-05 13:44:48 -05:00
Rob Scott
f38904d6f4
Adding PathType to Ingress
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-03 11:11:16 -08:00
Rob Scott
132d2afca0
Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2020-03-01 18:17:09 -08:00
Quan Tian
ea693833c8 Validate Except of IPBlock for NetworkPolicy spec
This patch enhances the validation of Except field that the values will
be rejected if they are not strictly within the CIDR range.
2020-02-05 01:35:44 +08:00
Antonio Ojea
f401d711aa
networkPolicy validation ipv6 unit tests
Add ipv6 cases to the validation unit tests.
2019-12-16 08:46:53 +01:00
Andrew Kim
c919139245 update import of generic featuregate code from k8s.io/apiserver/pkg/util/feature -> k8s.io/component-base/featuregate 2019-05-08 10:01:50 -04:00
Jordan Liggitt
47cb9559be Move internal Ingress type from extensions to networking 2019-02-20 16:41:12 -05:00
Laszlo Janosi
cbe94df8c6 gofmt update 2018-08-27 05:59:50 +00:00
Laszlo Janosi
e466bdc67e Changes according to the approved KEP. SCTP is supported for HostPort and LoadBalancer. Alpha feature flag SCTPSupport controls the support of SCTP. Kube-proxy config parameter is removed. 2018-08-27 05:58:36 +00:00
Laszlo Janosi
a6da2b1472 K8s SCTP support implementation for the first pull request
The requested Service Protocol is checked against the supported protocols of GCE Internal LB. The supported protocols are TCP and UDP.

SCTP is not supported by OpenStack LBaaS. If SCTP is requested in a Service with type=LoadBalancer, the request is rejected. Comment style is also corrected.

SCTP is not allowed for LoadBalancer Service and for HostPort. Kube-proxy can be configured not to start listening on the host port for SCTP: see the new SCTPUserSpaceNode parameter

changed the vendor github.com/nokia/sctp to github.com/ishidawataru/sctp. I.e. from now on we use the upstream version.

netexec.go compilation fixed. Various test cases fixed

SCTP related conformance tests removed. Netexec's pod definition and Dockerfile are updated to expose the new SCTP port(8082)

SCTP related e2e test cases are removed as the e2e test systems do not support SCTP

sctp related firewall config is removed from cluster/gce/util.sh. Variable name sctp_addr is corrected to sctpAddr in pkg/proxy/ipvs/proxier.go

cluster/gce/util.sh is copied from master
2018-08-27 05:56:27 +00:00
Dan Winship
329639e9f6 Allow including both podSelector and namespaceSelector in a NetworkPolicyPeer 2018-02-26 14:59:56 -05:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
xiangpengzhao
b0ebcaf8f0 Add unit test coverage for network policy validation. 2017-11-01 22:01:22 +08:00
Christopher M. Luciano
90b139897e
Add PolicyTypes to NetworkPolicy Spec
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2017-09-05 12:16:19 -04:00
Christopher M. Luciano
b03302f905
Add EgressRule to NetworkPolicy
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2017-09-05 12:01:07 -04:00
Christopher M. Luciano
b75dc93dd4
Add IPBlock to NetworkPolicy
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2017-08-24 16:20:04 -04:00
Dan Winship
c03a6ecca0 Allow NetworkPolicy.spec updates 2017-06-07 09:49:43 -04:00
Dan Winship
0683e55fc1 Add networking.k8s.io v1 API, with NetworkPolicy 2017-05-28 10:11:01 -04:00