Commit Graph

188 Commits

Author SHA1 Message Date
Dan Winship
7a56b6e3f7 Add validation.IsValidCIDR
Move apivalidation.ValidateCIDR to apimachinery, and rename it and
change its return value to match the other functions.

Also, add unit tests.

(Also, while updating NetworkPolicy validation for the API change, fix
a variable name that implied that IPBlock.Except[] is IP-valued rather
than CIDR-valued.)
2024-02-07 09:48:01 -05:00
Kubernetes Prow Robot
052bce26f4
Merge pull request #122931 from danwinship/ip-validation-cleanup
consistently use IsValidIP for IP validation
2024-02-06 15:58:15 -08:00
liyuerich
e490439262 drop deprecated pointer package
Signed-off-by: liyuerich <yue.li@daocloud.io>
2024-01-24 19:44:07 +08:00
Dan Winship
1d59d6b6c6 Use validation.IsValidIP in a few more places
Rather than using netutils.ParseIPSloppy directly.

Also fix the field paths in the errors for pod.spec.hostAliases to
include the array index.
2024-01-23 09:10:35 -05:00
Antonio Ojea
fee07ad608 make update with the new API with arrays 2023-10-31 21:05:58 +00:00
Antonio Ojea
c3d9b77d94 update ServiceCIDR API: replace IPv4,IPv6 fields by an array of strings
https: //docs.google.com/document/d/1-CKDPRHsG6XfnGs-Bb7ptWgDtTq9-hj8aJQpGz1CSh8/edit

Change-Id: If7134a5553b4ecc12b1d58ffc52ebb9f8594778a
2023-10-31 21:05:06 +00:00
Antonio Ojea
8182c4d9ec make update
Change-Id: I4007d4f6dda24b5c74f602d35191556f315de222
2023-10-31 21:05:05 +00:00
Antonio Ojea
632081a907 add ServiceCIDR APIs
Change-Id: Ia084c5505e43033ac34449031a1d32418ca326fd

Change-Id: Iafc236d456f7185a5c89a65d7b96245e04060013
2023-10-31 21:05:04 +00:00
Antonio Ojea
16363b6fb4 fix IPAddress.Name validation message
Change-Id: Idc29166d69c1eadd6e4dac3bf16f4a6739f98be2
2023-10-31 21:05:04 +00:00
Antonio Ojea
c2d473f0d4 remove ClusterCIDR
KEP-2593 proposed to expand the existing node-ipam controller
to be configurable via a ClusterCIDR objects, however, there
were reasonable doubts on the SIG about the feature and after
several months of dicussions we decided to not move forward
with the KEP intree, hence, we are going to remove the existing
code, that is still in alpha.

https://groups.google.com/g/kubernetes-sig-network/c/nts1xEZ--gQ/m/2aTOUNFFAAAJ

Change-Id: Ieaf2007b0b23c296cde333247bfb672441fe6dfc
2023-10-14 19:06:22 +00:00
Antonio Ojea
e9957d79aa make update
Change-Id: I61be34cff942264acb2f45fe7e1c8538f807cb4e
2023-10-10 11:03:19 +00:00
Antonio Ojea
b7ee8e8422 drop UID from the IPAddress.Spec.ParentRef
This field is not needed, IPAddresses are unique and
the name is canonicalized to avoid duplicates.

Change-Id: Iccaaf5d55e2af61fea7af9abd39584a80ed4054e
2023-10-10 11:03:19 +00:00
Tim Hockin
d55b67b349
Clean up brace whitespace in **/validation_test.go
This was making my eyes bleed as I read over code.

I used the following in vim.  I made them up on the fly, but they seemed
to pass manual inspection.

:g/},\n\s*{$/s//}, {/
:w
:g/{$\n\s*{$/s//{{/
:w
:g/^\(\s*\)},\n\1},$/s//}},/
:w
:g/^\(\s*\)},$\n\1}$/s//}}/
:w
2023-05-02 00:48:42 -07:00
Ricardo Katz
ec997d5433 Generated files for NetworkPolicyStatus removal 2023-05-01 15:19:25 -03:00
Ricardo Katz
bff8a6cd9f Remove withdrawn feature NetworkPolicyStatus 2023-05-01 15:19:25 -03:00
Stephen Kitt
4911e9de4a
api: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-05-01 09:16:15 +02:00
mouuii
becf73a82b add invaild scope test case
Signed-off-by: mouuii <49775493+mouuii@users.noreply.github.com>
2023-04-14 11:55:08 +08:00
Kubernetes Prow Robot
8decaf3ae7
Merge pull request #115447 from kidddddddddddddddddddddd/ingress
[ingress] Create with ingressClass annotation and IngressClassName both set
2023-03-15 02:02:16 -07:00
Antonio Ojea
ba42ed9a49 make update
Change-Id: I19e12ca05d977dca63043cb07ecf8a90e0e525c5
2023-03-14 22:58:12 +00:00
Antonio Ojea
c36562dfd7 IPAddress validation
Validate IPAddress name is in canonical format
Validate ParentRef is required, and Resource and Name.
Validate IPAddress is inmutable on update.
2023-03-14 22:56:44 +00:00
Antonio Ojea
036f57f3cb Add IPAddress API
Change-Id: I9cf710f011b58409ab880d3b2e7f841f228ee5ee
2023-03-14 22:56:44 +00:00
kidddddddddddddddddddddd
488d7650f4 update description 2023-03-14 09:42:41 +08:00
kidddddddddddddddddddddd
113355a5a2 loosen check rules for ingress creation 2023-02-01 15:21:45 +08:00
RuquanZhao
d5b4644d23 fix doc of types.go of network v1, v1alpha1, v1beta1
Signed-off-by: Ruquan Zhao <ruquan.zhao@arm.com>
2023-01-10 20:24:51 +08:00
TommyStarK
f166a52573 pkg/apis: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-05 11:48:05 +01:00
Jordan Liggitt
fc69084bf1
Update workload selector validation 2022-11-07 20:52:02 -05:00
Manjusaka
0843c4dfca
Add extra value validation for matchExpression field in LabelSelector 2022-11-07 20:48:21 -05:00
Tim Hockin
0153bfad16
Copy LoadBalancerStatus from core to networking
This type should never have been shared between Service and Ingress.
The `ports` field is unfortunate, but it is needed to stay compatible.
2022-11-02 16:13:31 -07:00
Antonio Ojea
fa7ed64dae use IPv6 Address Prefix Reserved for Documentation for api docs 2022-09-08 09:45:04 +02:00
Sarvesh Rangnekar
299724d099 Auto generate code for ClusterCIDR API 2022-08-05 01:06:35 +00:00
Sarvesh Rangnekar
7093b10416 Introduce networking/v1alpha1 api, ClusterCIDR type
Introduce networking/v1alpha1 api group.

Add `ClusterCIDR` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.
2022-08-05 00:54:00 +00:00
Kubernetes Prow Robot
65361245ed
Merge pull request #110824 from Abirdcfly/simple
cleanup:use copy other than for loop
2022-07-06 12:03:33 -07:00
Ricardo Katz
3e7bdbbf30 Promote endPort to GA 2022-06-30 00:33:43 +00:00
Abirdcfly
f715e9cb24 cleanup:use copy other than for loop
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-06-28 16:29:22 +08:00
renzheng.wang
7486d1bf1b fix comment of IngressClassParametersReferenceScopeCluster 2022-04-15 23:22:50 +08:00
James Laverack
7d57d5c70d Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"
This reverts commit b9792a9dae.
2022-04-13 13:58:19 +01:00
Sarvesh Rangnekar
b9792a9dae
Introduce APIs to support multiple ClusterCIDRs (#108290)
* Introduce networking/v1alpha1 api, ClusterCIDRConfig type

Introduce networking/v1alpha1 api group.

Add `ClusterCIDRConfig` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.

* Change ClusterCIDRConfig.NodeSelector type in api

* Fix review comments for API

* Update ClusterCIDRConfig API Spec

Introduce PerNodeHostBits field, remove PerNodeMaskSize
2022-03-30 19:39:00 -07:00
Ricardo Katz
42a1201082
Implementation on Network Policy Status (#107963)
* Implement status subresource in NetworkPolicy

* add NetworkPolicyStatus generated files

* Fix comments in netpol status review
2022-03-29 01:52:48 -07:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Harry Bagdi
d09a8c0a88 Graduate IngressClassNamespacedParams to GA 2021-11-10 08:58:39 -08:00
Jordan Liggitt
ba1ca0d459 Propagate conversion errors 2021-09-13 12:04:16 -04:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Jordan Liggitt
87a4e082ac Change defaulter-gen input to package path 2021-08-14 11:00:18 -04:00
Jordan Liggitt
c702dd4394 Drop legacy validation logic for networking API 2021-08-09 12:37:45 -04:00
Vikram Jadhav
a9a3c4bb9a Refactor of TestValidateIngressClass and TestValidateIngressClassUpdate methods by adding Boilerplate in helper functions #FIXES: 99005 2021-07-07 22:35:35 +05:30
Kubernetes Prow Robot
21f41b8e82
Merge pull request #101711 from hbagdi/ingressclass-namespaced-params-beta
graduate IngressClassNamespacedParams to beta
2021-06-29 17:07:03 -07:00
Harry Bagdi
f0d917a3ca add fuzzer patch to fix tests 2021-06-29 12:59:59 -07:00
Ricardo Pchevuzinske Katz
9f18ddf03c Promote endPort field in netpolicies to beta
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>
2021-06-15 10:47:17 -03:00
Kubernetes Prow Robot
09268c1685
Merge pull request #101627 from rikatz/fix-ingress-doc
Change ingress api doc to reflect the correct path validation
2021-05-13 05:44:25 -07:00