52223 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
336a32a270 Merge pull request #130693 from novahe/fix/test-cases
Fix test cases that may potentially cause a panic.
2025-03-13 05:33:49 -07:00
Kubernetes Prow Robot
953b40b34e Merge pull request #128857 from zhifei92/flagz-kubelet
feat: Add flagz endpoint for kubelet
2025-03-13 02:57:45 -07:00
carlory
aab7a079fa make each scheduler test independent
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-13 14:39:50 +08:00
Kubernetes Prow Robot
9acdca64e0 Merge pull request #130724 from jpbetz/replication-controller-to-declarative
Enable Declarative Validation for ReplicationController
2025-03-12 22:41:53 -07:00
Kubernetes Prow Robot
7f818e9f02 Merge pull request #130602 from tallclair/allocation-checkpoint-optimization
Allocation checkpoint cleanup
2025-03-12 22:41:46 -07:00
Kubernetes Prow Robot
92d7e55abd Merge pull request #129886 from danwinship/endpointslice-api-notes
Try to clarify EndpointSlice semantics some more
2025-03-12 21:19:53 -07:00
Kubernetes Prow Robot
761f5646be Merge pull request #130138 from rata/userns-enabled-by-default
features: Enable user namespaces by default
2025-03-12 20:13:48 -07:00
zhangzhifei16
2db729cfa4 Add flatz to kubelet auth.
Fix: Move flagz to InstallDebuggingHandlers.

Move flagz  to the lower switch statemen

Fix linter

Drop the function parameter for the read-only server.
2025-03-13 10:11:59 +08:00
Kubernetes Prow Robot
7b6c56e5fb Merge pull request #130135 from saschagrunert/image-volume-beta
[KEP-4639] Graduate image volume sources to beta
2025-03-12 18:03:58 -07:00
Kubernetes Prow Robot
05bfdbc6dd Merge pull request #129950 from ffromani/alignment-error-detail-metrics
node: metrics for alignment failures
2025-03-12 18:03:46 -07:00
Joe Betz
ed08387663 Enable versioned validation fuzz testing for core v1 group 2025-03-12 19:53:47 -04:00
Joe Betz
b5bc283808 ReplicationController: Add declarative validation test suite
Introduce a test suite that ensures declarative test cases
are fully tested and that validation errors are compared
with handwritten validation to ensure consistency.

Co-authored-by: Tim Hockin <thockin@google.com>
Co-authored-by: Aaron Prindle <aprindle@google.com>
Co-authored-by: Yongrui Lin <yongrlin@google.com>
2025-03-12 19:53:44 -04:00
Joe Betz
5a5ed81e1f ReplicationController: Enable declarative validation
After declarative validation is enabled in the ReplicationController
strategy in this way, the generated declarative validation code
in pkg/apis/core/v1/zz.generated.validations.go will be run
when the strategy validates ReplicationController.

Co-authored-by: Tim Hockin <thockin@google.com>
Co-authored-by: Aaron Prindle <aprindle@google.com>
Co-authored-by: Yongrui Lin <yongrlin@google.com>
Co-authored-by: David Eads <deads@redhat.com>
2025-03-12 19:51:31 -04:00
Kubernetes Prow Robot
2261137135 Merge pull request #122550 from danwinship/tighten-ip-validation
Tighten IP/CIDR validation
2025-03-12 15:57:46 -07:00
Tim Allclair
e8547d8a54 Cleanup unused container parameter from allocation state Delete 2025-03-12 15:19:38 -07:00
Tim Allclair
05a9c06212 Don't update checkpoint file for deletion 2025-03-12 15:19:14 -07:00
Tim Allclair
30bca329c5 Don't re-write the checkpoint file when the content is unchanged 2025-03-12 15:11:39 -07:00
Tim Hockin
e856356225 Enable validation-gen on core/v1
This enables generation but does not activate the strategy calling of
declarative.
2025-03-12 18:05:20 -04:00
Kubernetes Prow Robot
8456726952 Merge pull request #130749 from aramase/aramase/c/kep_4412_typedef_get_sa
Define type alias for getServiceAccount function
2025-03-12 13:36:20 -07:00
Kubernetes Prow Robot
21f7eaa8e2 Merge pull request #130705 from aaron-prindle/validation-gen-add-metric-and-runtime-verification-upstream
[Declarative Validation] feat: add declarative validation metrics and associated runtime verification tests
2025-03-12 11:29:54 -07:00
Kubernetes Prow Robot
6b8341fc2e Merge pull request #130544 from jsafrane/selinux-beta
selinux: Promote SELinuxChangePolicy and SELinuxMount to beta
2025-03-12 11:29:47 -07:00
Anish Ramasekar
b27735be2e Define type alias for getServiceAccount function
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-03-12 10:08:46 -07:00
Dan Winship
ad22c0d495 Fix IP/CIDR validation to allow updates to existing invalid objects
Ignore pre-existing bad IP/CIDR values in:
  - pod.spec.podIP(s)
  - pod.spec.hostIP(s)
  - service.spec.externalIPs
  - service.spec.clusterIP(s)
  - service.spec.loadBalancerSourceRanges (and corresponding annotation)
  - service.status.loadBalancer.ingress[].ip
  - endpoints.subsets
  - endpointslice.endpoints
  - networkpolicy.spec.{ingress[].from[],egress[].to[]}.ipBlock
  - ingress.status.loadBalancer.ingress[].ip

In the Endpoints and EndpointSlice case, if *any* endpoint IP is
changed, then the entire object must be valid; invalid IPs are only
allowed to remain in place for updates that don't change any IPs.
(e.g., changing the labels or annotations).

In most of the other cases, when the invalid IP is part of an array,
it can be moved around within the array without triggering
revalidation.
2025-03-12 12:41:32 -04:00
Kubernetes Prow Robot
caf541857f Merge pull request #130673 from gauravkghildiyal/kep-4444-ga
Promote ServiceTrafficDistribution feature-gate to GA and update docs with latest descriptions
2025-03-12 08:23:47 -07:00
Kubernetes Prow Robot
1c756849d6 Merge pull request #130591 from fmuyassarov/devel/logging
Refine logging levels in job, IPAM, and replicaSet
2025-03-12 07:13:47 -07:00
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
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
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 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
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
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
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
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
Marek Siarkowicz
f5dd7107f7 Implement streaming proto encoding 2025-03-11 21:49:50 +01: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
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
Aaron Prindle
cd9df2f115 chore: change error_matcher.go to use test interface instead of importing testing pkg 2025-03-11 18:15:50 +00: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