236 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
2fdba619ab Merge pull request #132979 from ylink-lfs/chore/residual_intptr_removal
chore: residual intptr removal with ptr.To
2025-07-16 12:12:38 -07:00
ylink-lfs
5b4c1872a0 chore: residual intptr removal with ptr.To 2025-07-16 09:07:25 +08:00
Kubernetes Prow Robot
a76eddf608 Merge pull request #132548 from gavinkflam/130656-fix-duplicate-validations-2
bug: Remove duplicate DaemonSet update validations
2025-07-15 12:06:30 -07:00
Davanum Srinivas
ebc1ccc491 Bump k8s.io/kube-openapi to latest SHA (f3f2b991d03b)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-07-14 07:24:48 -04:00
joey
dfd34a5b18 fix pod template spec validation missing in sts
Signed-off-by: joey <zchengjoey@gmail.com>
2025-06-27 16:30:51 +08:00
Gavin Lam
c6c15bbe44 bug: Remove duplicate DaemonSet update validations
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2025-06-26 00:11:20 -04:00
Kubernetes Prow Robot
988cf21f09 Merge pull request #131873 from gavinkflam/130656/remove-duplicate-replicaset-update-validation
bug: Remove duplicate ReplicaSet update validation
2025-06-11 13:21:02 -07:00
Maciej Szulik
2bf3d8b733 KEP-3335: drop StatefulSetStartOrdinal feature gate
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-06-05 14:02:44 +02:00
Gavin Lam
b571840d00 bug: Remove duplicate ReplicaSet update validation
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2025-05-20 23:05:17 -04:00
Luca Lanziani
2ea6892077 Always check for Immutable selector in Deployment Replicaset Daemonset (#131017)
* Always for Immutable selector in Deployment Replicaset Daemonset

With extensions/v1beta1 removed there is no need of a special case
to check for Spec.Selector immutability.

The ValidateImmutableField is now moved into the
Validate[Resource]Update method, tests for v1beta1 are removed and test
for v1 are added.

Validation tests were updated to reflect the changes,
mostly decoupling other fields changes from selectors and creating a
dedicated case to test selector immutability.

* Move validation inside appropriate function

* Fix validation tests
2025-04-23 15:58:37 -07:00
Filip Křepinský
8db1426554 rename DeploymentPodReplacementPolicy FG to DeploymentReplicaSetTerminatingReplicas 2025-03-27 20:27:44 +01:00
Maciej Szulik
1fa995224a Update scale sub-resource to return the same error everywhere
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-01-28 15:42:08 +01:00
Filip Křepinský
14783b8a9b add validation, field disablement and tests 2025-01-23 22:26:34 +01:00
Arda Güçlü
7c887412c8 Add validation for revisionHistoryLimit in sts to prevent negative value (#129017)
* Add validation for revisionHistoryLimit in sts to prevent negative value

* Add unit tests to verify warning messages
2025-01-06 20:04:31 +01:00
Patrick Ohly
8a908e0c0b remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
2024-12-02 16:59:34 +01:00
Kubernetes Prow Robot
3b6978051b Merge pull request #121897 from carlory/ds-registry-test
daemonset registry: add unit test for UpdateStatus
2024-11-07 06:29:29 +00:00
Peter Schuurman
585971431b Remove StatefulSetStartOrdinal feature gate to target stable in 1.31 2024-07-16 08:05:09 -07:00
Michael Fraenkel
cd949bafa4 use MakePodSpec consistently (#125805)
cleaning up some tests after MakePod/MakePodSpec were introduced
2024-06-30 10:28:36 -07:00
Michael Fraenkel
a7264f95ff pod terminationGracePeriodSeconds is always valid (#124461)
* Pod terminationGracePeriodSeconds is always valid

Validation of a pod spec will always use the pod's
TerminationGracePeriodSeconds value.

A set of pod test-helpers have been created to help construct Pods.

* remove unused func

* reduction

* reduce 2

* simplify test

* report invalid grace period

* update SupplementalGroupPolicy tests
2024-06-29 18:09:29 -07:00
Jordan Liggitt
d6d78c5581 Ensure controller revision data is valid json 2024-06-17 14:32:51 -04:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
carlory
3475c3e955 daemonset registry: add unit test for UpdateStatus 2023-11-15 16:03:48 +08:00
Michelle Au
c4aab1036f Add sig OWNERS to registry packages 2023-10-31 01:20:16 +00:00
git-jxj
a5b3a4b738 cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Stephen Kitt
026e7c7cb3 registry: 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:17:45 +02:00
Tim Hockin
29c0b73d64 Replace uses of diff.ObjectDiff with cmp.Diff
ObjectDiff is already a shim over cmp.Diff, so no actual output or
behavior changes
2023-04-12 08:46:12 -07:00
Antoine Pelisse
4f3859ce91 managedfields: Move most of fieldmanager package to managefields 2023-03-08 13:44:00 -08:00
Peter Schuurman
773b45abc5 Add enablement/disablement unit test for StatefulSetStartOrdinal feature 2023-02-05 20:28:54 -08:00
Kubernetes Prow Robot
12c71fdf1c Merge pull request #113542 from ardaguclu/fix-shortname-disperancy
Set singular names for core types to pass to discovery
2023-01-03 09:29:43 -08:00
Tim Hockin
b65cec86eb deployment: API warn when name is not DNS label 2022-12-16 13:07:13 -08:00
Tim Hockin
820e2fff0d rs: API warn when name is not DNS label 2022-12-16 13:06:43 -08:00
Arda Güçlü
1abf94bec3 Remove GetSingularName for subresources 2022-11-18 12:21:19 +03:00
Arda Güçlü
672e0b1e01 Use correct singular name format for subresources 2022-11-18 12:21:19 +03:00
Arda Güçlü
578ddde80e Add singular name for the rest of types 2022-11-18 12:21:13 +03:00
Arda Güçlü
0990ba1cc9 Introduce singularNameProvider for core types
This introduces `singularNameProvider`. This provider will be used
by core types to have their singular names are defined in discovery
endpoint. Thanks to that, core resources singular name always have
higher precedence than CRDs shortcuts or singular names.
2022-11-18 12:21:07 +03:00
Peter Schuurman
366997951b Update doc comments and change name of feature gate 2022-11-08 07:48:10 -08:00
Peter Schuurman
7b3d77a41a Adding implementation of KEP-3335, StatefulSetSlice 2022-11-08 07:48:00 -08:00
Jordan Liggitt
fc69084bf1 Update workload selector validation 2022-11-07 20:52:02 -05:00
Paco Xu
140502af8c add warning for PVC template in statefulset and in pod ephemeral volume source 2022-10-22 09:14:03 +08:00
Davanum Srinivas
a9593d634c Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Kubernetes Prow Robot
7156c96e5d Merge pull request #111194 from ravisantoshgudimetla/promote-maxSurge-ga
Promote DS max surge to GA
2022-07-25 06:20:46 -07:00
Kubernetes Prow Robot
1c1efde70d Merge pull request #109639 from Abirdcfly/fixduplicateimport
cleanup: remove all duplicate import
2022-07-18 16:55:23 -07:00
Ravi Gudimetla
7397c029e8 Promote DS MaxSurge to GA 2022-07-18 07:54:59 -04:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
Ravi Gudimetla
9144250a92 Promote minReadySeconds to GA 2022-07-13 11:37:10 -04:00
areller
a6943ad863 [fix] fix and refactor TestValidateStatefulSet and TestValidateStatefulSet test cases (#109809)
* restructure tests

restructure TestValidateStatefulSet and TestValidateStatefulSetUpdate to be an array and accept list of expected errors. in this commits, no tests were changed and expected errors are not filled yet

* add expected errors

adding expected errors and making the tests pass, without making any changes to the tests

* clean up TestValidateStatefulSet error cases

* clean up TestValidateStatefulSetUpdate cases

* validate new statefulset as part of update validation

* address PR comments
2022-05-24 11:55:24 -07:00
Wojciech Tyczyński
80060a502c Implement Destroy() method for all registries 2022-04-19 15:59:13 +02:00
Mayank Kumar
357203d992 API: maxUnavailable for StatefulSet 2022-03-28 11:01:05 -07:00
Patrick Ohly
edffc700a4 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.
2022-03-24 11:13:50 +01:00
Kubernetes Prow Robot
9fbe66a486 Merge pull request #103516 from ykakarap/kubectl-subresources-apiserver
kubectl: apiserver changes to add --subresource support
2022-03-23 13:21:32 -07:00