Commit Graph

128722 Commits

Author SHA1 Message Date
Dan Winship
692785d25b Add legacy versions of IsValidIP/IsValidCIDR
Add validation.IsValidIPForLegacyField and
validation.IsValidCIDRForLegacyField, which validate "legacy" IP/CIDR
fields correctly. Use them for all such fields (indirectly, via a
wrapper in pkg/apis/core/validation that handles the
StrictIPCIDRValidation feature gate correctly).

Change IsValidIP and IsValidCIDR to require strict parsing and
canonical form, and update the IPAddr, ServiceCIDR, and
NetworkDeviceData validation to make use of them.
2025-03-12 09:58:04 -04:00
Dan Winship
ba189de78f Slightly improve EndpointSlice address validation
Because it used both IsValidIPv4Address and ValidateEndpointIP,
EndpointSlice validation produced duplicate error messages when given
an invalid IP. Fix this by calling IsValidIP first, and only doing the
other checks if that one fails.

Also, since no one else was using the IsValidIPv4Address and
IsValidIPv6Address methods anyway, just inline them into the
EndpointSlice validation, so we don't have to worry about "should they
do legacy or strict validation" later.
2025-03-12 09:37:39 -04:00
Dan Winship
fc4bb4fdb9 Add validation.IsValidInterfaceAddress
Split "ifaddr"-style ("192.168.1.5/24") validation out of IsValidCIDR.
Since there is currently only one field that uses this format, and it
already requires canonical form, IsValidInterfaceAddress requires
canonical form unconditionally.
2025-03-12 09:37:39 -04:00
Dan Winship
f79bccf4d9 validation unit test cleanups
Fix some incorrect test case names.

Use t.Run() in a few more places (to facilitate using
SetFeatureGateDuringTest later).

Clarify TestPodIPsValidation/TestHostIPsValidation (and fix
weird indentation).
2025-03-12 09:37:39 -04:00
Dan Winship
76f1684117 Rename ValidateNonSpecialIP to ValidateEndpointIP
There is not a single definition of "non-special IP" that makes sense
in all contexts. Rename ValidateNonSpecialIP to ValidateEndpointIP and
clarify that it shouldn't be used for other validations.

Also add a few more unit tests.
2025-03-12 09:37:39 -04:00
Kubernetes Prow Robot
e0ab1a16ad
Merge pull request #128372 from aramase/aramase/f/kep_4412_alpha_impl
KSA token for Kubelet image credential providers alpha
2025-03-12 00:39:50 -07:00
Kubernetes Prow Robot
0b00454617
Merge pull request #125102 from 0xMALVEE/unit-tests-listers.go
Add unit tests to client-go/tools/cache/listers.go
2025-03-11 23:33:46 -07:00
Kubernetes Prow Robot
7d6700a532
Merge pull request #130739 from jpbetz/declarative-validation-test-infra
Introduce versioned validation test utilitizes and add fuzz tester
2025-03-11 21:37:53 -07:00
Kubernetes Prow Robot
c28e7ffe24
Merge pull request #130708 from fuweid/reduce-spans-in-writer
*: reduce tracing events during streaming JSON objects
2025-03-11 21:37:46 -07:00
Anish Ramasekar
2090a01e0a
add e2e test with the gcp-credential-provider test plugin
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 20:36:36 -07:00
Anish Ramasekar
ad8666ce88
Update credential provider plugin to support using service account token
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 20:36:32 -07:00
Kubernetes Release Robot
69dd6b3c0e CHANGELOG: Update directory for v1.32.3 release 2025-03-12 03:32:49 +00:00
Kubernetes Release Robot
dd25c6a6cb CHANGELOG: Update directory for v1.31.7 release 2025-03-12 02:56:24 +00:00
Kubernetes Prow Robot
c7c0c62edb
Merge pull request #130737 from aaron-prindle/validation-gen-rename-extra-arg-flag-upstream
[Declarative Validation] chore(validation-gen): rename flag --extra-pkg -> --readonly-pkg in validation-gen
2025-03-11 19:48:13 -07:00
Kubernetes Prow Robot
7edfb53f1f
Merge pull request #130736 from siyuanfoundation/owner
Add approver permission for jpbetz in component-base/compatibility
2025-03-11 19:48:06 -07:00
Kubernetes Prow Robot
f13237a34e
Merge pull request #130735 from Jefftree/cle-lexo-check
CLE: Remove invalid emulated version and add lexographical order test
2025-03-11 19:47:59 -07:00
Kubernetes Prow Robot
6ef9938e4a
Merge pull request #130647 from alexandear/golangci-fix-forbidigo-settings
hack: fix settings for forbidigo linter
2025-03-11 19:47:52 -07:00
Kubernetes Prow Robot
4a0566c25b
Merge pull request #130575 from Jefftree/cle-e2e
Add E2E tests for CLE
2025-03-11 19:47:45 -07:00
Kubernetes Release Robot
34349e735c CHANGELOG: Update directory for v1.30.11 release 2025-03-12 01:38:34 +00:00
Tim Hockin
1d365762a5 Introduce versioned validation test utilitizes and add fuzz tester
This makes a bold assumption: that the errors (count and basic content)
will be the same across versions.  If this turns out to be untrue, this
may need to get more sophisticated.  It should fail obviously when we
hit that edge.
2025-03-11 20:37:21 -04:00
Kubernetes Release Robot
3eaa047850 CHANGELOG: Update directory for v1.29.15 release 2025-03-12 00:36:01 +00:00
Anish Ramasekar
6defd8c0bd
node authorizer changes to allow read on svcaccounts
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:26:45 -05:00
Anish Ramasekar
d398de294d
Add KubeletServiceAccountTokenForCredentialProviders feature gate
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:24:54 -05:00
Anish Ramasekar
dd7b9f6171
Add service account token and annotation to v1 CredentialProviderRequest
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:24:43 -05:00
Anish Ramasekar
ba2eecca0d
Add TokenAttributes field to v1 CredentialProvider
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-11 19:24:39 -05:00
Kubernetes Prow Robot
31d16ff2c2
Merge pull request #130734 from jpbetz/core-validation-pointer-to-ptr
util/pointer->ptr for core v1 fuzzer and validation tests
2025-03-11 17:11:52 -07:00
Kubernetes Prow Robot
1b6e321e23
Merge pull request #129407 from serathius/streaming-proto-list-encoder
Implement streaming proto list encoder
2025-03-11 17:11:45 -07:00
Wei Fu
003f215767 *: reduce tracing events during streaming JSON objects
If apiserver is handing heavy traffic volume, it's likely to trigger
tracing events. After streaming JSON objects, the number of tracing events
are same to object number. It's unneccessary to log each write call.
This patch is to reduce tracing events.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2025-03-11 19:02:31 -04:00
Kubernetes Prow Robot
c5d4e53444
Merge pull request #130731 from Jefftree/cle-int-refactor
Fix context usage in CLE integration test
2025-03-11 15:59:52 -07:00
Kubernetes Prow Robot
f3a23cfe90
Merge pull request #130730 from jpbetz/minimum-tag
Add +k8s:minimum validation tag
2025-03-11 15:59:46 -07:00
Siyuan Zhang
b9cb44a593 Add approver permission for jpbetz in component-base/compatibility
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2025-03-11 14:33:18 -07:00
Kubernetes Release Robot
d6f61438e0 CHANGELOG: Update directory for v1.33.0-beta.0 release 2025-03-11 21:32:32 +00:00
Kubernetes Prow Robot
549b9117a7
Merge pull request #130716 from pacoxu/fix-bind-address-already-in-use
use diff port for TestCreateConfigWithoutWebHooks from TestCreateConfig
2025-03-11 14:05:47 -07:00
Joe Betz
9fe18bf486 Update core v1 fuzzer and validation tests to use util/ptr instead of util/pointer 2025-03-11 17:02:55 -04:00
Jefftree
775b118a6d Remove invalid emulated version and add lexographical order test 2025-03-11 21:00:48 +00:00
Jefftree
9eef88c844 Add CLE e2e tests 2025-03-11 20:54:45 +00:00
Marek Siarkowicz
f5dd7107f7 Implement streaming proto encoding 2025-03-11 21:49:50 +01:00
Tim Hockin
d6ef05b9a8 Add +k8s:minimum validation tag 2025-03-11 16:47:05 -04:00
Kubernetes Prow Robot
ac05e1a48e
Merge pull request #130533 from Henrywu573/parall
Parallelize lease candidate ping
2025-03-11 12:47:53 -07:00
Kubernetes Prow Robot
309c4c17fb
Merge pull request #128499 from stlaz/ctb_betav1
ClusterTrustBundles - move to beta
2025-03-11 12:47:45 -07:00
Jefftree
b7b1e78d62 Fix context usage 2025-03-11 19:29:21 +00:00
Aaron Prindle
cfcf7e93a3 chore(validation-gen): rename flag --extra-pkg -> --readonly-pkg in validation-gen 2025-03-11 19:17:48 +00:00
Oleksandr Redko
ca4f785757
Update hack/verify-golangci-lint.sh
Co-authored-by: Benjamin Elder <bentheelder@google.com>
2025-03-11 11:45:45 -07:00
Kubernetes Prow Robot
652f681c2b
Merge pull request #130650 from natasha41575/pod-conditions-controller
[FG:PodObservedGenerationTracking] controller sets observedGeneration on pod conditions
2025-03-11 11:27:54 -07:00
Kubernetes Prow Robot
6bb5901e2d
Merge pull request #129058 from dom4ha/nominated_cluster_event
Trigger all pods rescheduling on nominated node changes
2025-03-11 11:27:47 -07:00
Stanislav Láznička
c36b1c901f
KCM: CTB publisher: tolerate NotFound during discovery 2025-03-11 18:07:33 +01:00
Stanislav Láznička
24e8fa769b
move ClusterTrustBundles featuregates to beta 2025-03-11 18:07:32 +01:00
Stanislav Láznička
1f1dbc35a9
kubelet: ctb: use generics to handle alpha/beta APIs for CTB projection 2025-03-11 18:07:31 +01:00
Stanislav Láznička
5b3b68a3a1
KCM: CTBPublisher: use generics to handle both alpha/beta APIs 2025-03-11 18:07:29 +01:00
Stanislav Láznička
d3f44a5bc0
kubelet: lazy enabling the ClusterTrustBundleProjection feature
Determine whether the ClusterTrustBundleProjection should be enabled
based on ClusterTrustBundle API discovery.
Some distributions may rely on a running kubelet in order to start
their kube-apiserver. Therefore we must delay the API discovery.

This patch delays it until the first time a clustertrustbundle is
requested from the InformerMaanager.
2025-03-11 18:07:28 +01:00