Commit Graph

474 Commits

Author SHA1 Message Date
Tim Hockin
46ac2af06a Fix validation test for ReplicationController
I discovered this by changing the validation in a way that SHOULD fail
(by allowing something it should not).  But it didn't.  A different
error happens which totally masks the non-failure I expected.  New test
is much more explicit about what failures are expected.

This does not focus on adding test coverage, just making sure the test
is not terrible.
2025-03-10 11:51:53 -07:00
Natasha Sarkar
eab9197d1a Add observedGeneration and validation to pod status and conditions 2025-03-06 20:08:06 +00:00
Kubernetes Prow Robot
4696667025 Merge pull request #130543 from thockin/error_matcher_and_origin
Fix up ErrorMatcher from feedback
2025-03-06 00:57:52 -08:00
Kubernetes Prow Robot
cd451c6a36 Merge pull request #130282 from natasha41575/podresizevalidation
Clean up preparation for pod subresource updates
2025-03-05 14:41:45 -08:00
Tim Hockin
0a9f492eed Fix up ErrorMatcher from feedback
a) Rename the type and drop the constructor
b) Make MatchErrors() into a Test() method

For followup:

c) Consider making ByType() assumed
d) Consider making ByField() assumed and handle nil as "don't care"
e) Consider making ByValue() assumed and handle nil as "don't care"
2025-03-05 09:52:44 -08:00
Natasha Sarkar
f91105a77e fix prep and validation for pod subresource updates 2025-02-28 16:51:10 +00:00
Tim Hockin
c8111709e5 Add an error matcher, convert 2 tests
I fixed up the TestValidateEndpointsCreate path to show the matcher
instead of manual origin checking.

I picked TestValidateTopologySpreadConstraints because it was the last
failing test on my screen when I changed on of the commonly hard-coded
error strings. I fixed exactly those validation errors that were needed
to make this test pass.  Some of the Origin values can be debated.

The `field/testing.Matcher` interface allows tests to configure the
criteria by which they want to match expected and actual errors.  The
hope is that everyone will use Origin for Invalid errors.

There's some collateral impact for tests which use exact-comparisons and
don't expect origins.  These are all candidates for using the matcher.
2025-02-28 08:36:26 -08:00
yongruilin
c7cf852086 test: Add Origin field support to ReplicationController spec.Replicas validation test 2025-02-28 06:56:02 +00:00
yongruilin
07477c656e test: convert ValidateEndpointsCreate to use error Origin field in test
Update ValidateEndpointsCreate validation tests to use the new Origin field for more precise error comparisons. It leverage the Origin field instead of detailed error messages, improving test robustness and readability.

Co-authored-by: Tim Hockin <thockin@google.com>
2025-02-28 06:55:58 +00:00
Kubernetes Prow Robot
f90682bf42 Merge pull request #130183 from tallclair/forbid-memory-limit-decrease
[FG:InPlacePodVerticalScaling] Forbid memory limit decrease
2025-02-20 13:46:33 -08:00
Tim Allclair
e52274a9e2 Don't allow resize policy mutation 2025-02-14 13:15:13 -08:00
Tim Allclair
a1595d9dca Don't allow memory limit decrease unless resize policy is RestartContainer 2025-02-14 12:38:52 -08:00
Adrian Moisey
6d58125111 Bump KEP-4427 : AllowRelaxedDNSSearchValidation to Beta 2025-02-14 19:39:18 +02:00
Kubernetes Prow Robot
0634e21fb5 Merge pull request #128367 from vivzbansal/sidecar-2
[FG:InPlacePodVerticalScaling] Implement resize for sidecar containers
2025-02-05 14:38:15 -08:00
Gunju Kim
0bee0bcaa7 Promote SidecarContainers feature to GA 2025-02-02 17:45:36 +09:00
Kubernetes Prow Robot
814e2c89a8 Merge pull request #128792 from vivzbansal/sidecar-3
Added unit test for resize policy validation check of sidecar containers
2025-01-29 18:23:22 -08:00
vivzbansal
5889da1bbc Resolved latest review comments 2025-01-27 19:46:54 +00:00
vivzbansal
6cf5b80c64 Fix some unit test error 2025-01-27 19:42:14 +00:00
vivzbansal
1cf4587277 Fix build error 2025-01-27 19:42:14 +00:00
vivzbansal
1eb966cb45 Added unit test for sidecar containers in TestValidatePodResize 2025-01-27 19:42:13 +00:00
vivzbansal
d1fac494f4 resolve merge conflicts 2025-01-27 19:42:13 +00:00
Kubernetes Prow Robot
7a504aa97b Merge pull request #129174 from RyanAoh/fix-115896
Remove the limitation on exposing port 10250 externally
2024-12-13 01:48:32 +01:00
Aohan Yang
e8087b3f6a Remove the limitation on exposing port 10250 externally 2024-12-12 19:45:19 +08:00
AxeZhan
ae11c7deb1 DisallowInvalidLabelValueInNodeSelector 2024-12-12 15:06:14 +08:00
vivzbansal
22c3db6f7f Added unit test for validation check of sidecar containers 2024-11-14 02:44:01 +00:00
Kubernetes Prow Robot
2691a29eac Merge pull request #128683 from AnishShah/validation
[FG:InPlacePodVerticalScaling] Disallow removing requests & limits for Burstable pods.
2024-11-08 09:08:43 +00:00
Kubernetes Prow Robot
c25f5eefe4 Merge pull request #128407 from ndixita/pod-level-resources
[PodLevelResources] Pod Level Resources Feature Alpha
2024-11-08 07:10:50 +00:00
Anish Shah
7680f0f293 api: reject removing requsets & limits for Burstable pods. 2024-11-07 21:06:54 -08:00
ndixita
8a8dc27b4e Adding the logic to validate pod-level resources as following:
1. The effective container requests cannot be greater than pod-level requests
2. Inidividual container limits cannot be greater than pod-level limits
3. Only CPU & Memory are supported at pod-level
4. Inplace container resources updates are not supported if pod-level resources are set
Note: effective container requests cannot be greater than pod-level limits is supported by transitivity. Effective container requests <= pod-level requests && pod-level requests <= pod-level limits; Therefore effective container requests <= pod-level limits

Signed-off-by: ndixita <ndixita@google.com>
2024-11-08 03:00:54 +00:00
ndixita
a2ddde877c Adding the logic to set default pod-level request as following:
1. If pod-level limit is set, pod-level request is unset and container-level request is set: derive pod-level request from container-level requests
2. If pod-level limit is set, pod-level request is unset and container-level request is unset: set pod-level request equal to pod-level limit
2024-11-08 03:00:54 +00:00
Kubernetes Prow Robot
46b3d9b320 Merge pull request #128186 from sreeram-venkitesh/117767-in-place-pod-vertical-scaling-version-skew
Updated version skew strategy for InPlacePodVerticalScaling
2024-11-08 02:21:14 +00:00
Sreeram Venkitesh
851dbf25e5 Added unit tests 2024-11-08 01:17:05 +05:30
Kubernetes Prow Robot
9660e5c4cd Merge pull request #127360 from knight42/feat/split-stdout-stderr-server-side
API: add a new `Stream` field to `PodLogOptions`
2024-11-07 19:44:45 +00:00
Lan Liang
6e5a3cde50 Remove PodHostIPs feature gates.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-11-06 23:10:36 -08:00
Sreeram Venkitesh
1739ee2ba9 Removed duplicated tests after rebase 2024-11-07 11:38:54 +05:30
Sreeram Venkitesh
385d2b198c Fixes from review, updated tests cases 2024-11-07 11:34:58 +05:30
Sreeram Venkitesh
4dae42a796 Updated version skew strategy for InPlacePodVerticalScaling 2024-11-07 11:29:07 +05:30
Anish Shah
207842d3e0 drop InPlacePodVerticalScaling support in windows 2024-11-06 12:57:55 -08:00
Jian Zeng
b9228836e1 feat: update validation helpers
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2024-11-06 21:27:12 +08:00
Kubernetes Prow Robot
648717cc74 Merge pull request #128266 from AnishShah/resize-subresource
[FG:InPlacePodVerticalScaling] Introduce  /resize subresource to request pod resource resizing
2024-11-06 06:59:29 +00:00
Kubernetes Prow Robot
a50b4e52a9 Merge pull request #128553 from thockin/master
Validation: merge TooLong and TooLongMaxLen
2024-11-06 04:19:43 +00:00
Anish Shah
0a80c5ecb7 better variable names 2024-11-06 01:33:15 +00:00
Anish Shah
7ac302b47a test: cleanup validation tests 2024-11-06 01:33:15 +00:00
Anish Shah
ce0f4597d3 fix error message for pod resize validation failure 2024-11-06 01:33:14 +00:00
Anish Shah
2bf1f2349c validate resize request
We validate resize request by ensuring that pod QoS is unchanged and
only cpu and memory resources and resize policies are mutated.
2024-11-06 01:33:14 +00:00
Tim Hockin
4d0e1c8fd4 Kill TooLongMaxLength() in favor of TooLong() 2024-11-05 15:10:22 -08:00
Kubernetes Prow Robot
5572688cef Merge pull request #128342 from gnufied/recovery-expansion-beta
Move RecoverVolumeExpansionFailure feature to beta
2024-11-04 23:15:36 +00:00
Kubernetes Prow Robot
97c79df18f Merge pull request #127981 from jsafrane/selinux-changepolicy
1710: Implement SELinuxChangePolicy
2024-11-04 22:09:29 +00:00
Kubernetes Prow Robot
6bc0768c62 Merge pull request #127744 from carlory/fix-126662
Tighten validation on the qosClass field of pod status
2024-11-01 22:33:27 +00:00
Jan Safranek
6ca7b959e4 Add SELinuxChangePolicy validation 2024-11-01 12:46:34 +01:00