Commit Graph

445 Commits

Author SHA1 Message Date
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
Tim Hockin
ae01c2126f
Remove the gate "SkipReadOnlyValidationGCE"
One less GCE-specifc wart in the codebase.
2024-04-06 15:11:20 -07:00
AxeZhan
070e7a38cb generic set 2023-10-28 15:31:28 +08:00
Stephen Kitt
aa89e6dc97
Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-09-08 11:10:50 +02:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02: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
Tim Hockin
ec3379a717
Do hostNet Pod-ports -> hostPorts in Pod defaults
Rather than doing it in PodSpec defaulting, which triggers in
Deployments and DaemonSets, do it only when a Pod is actually in play.
2023-05-09 18:10:20 -07: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
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
mfordjody
c3384191ea remove validation GCE-ism
update testing

update testing

update testing

update core and testing

update testing
2023-04-24 14:27:37 +08:00
Kubernetes Prow Robot
4c6d6aa482
Merge pull request #116602 from mattcary/fuzz
Simplify statefulset fuzzer
2023-04-13 17:24:38 -07:00
Kubernetes Prow Robot
c4ebf5f1e3
Merge pull request #116722 from luoqr96/myfeature
Chore: test simplification for stateful set
2023-04-11 18:19:37 -07:00
Kubernetes Prow Robot
d0fc9d16ce
Merge pull request #114800 from haoruan/feature-8976-spew-sprintf-refactor
Capture spew.Sprintf() with all our favorite config into a util func
2023-04-11 15:34:57 -07:00
Hao Ruan
f638e2849f replaced spew.Sprintf with a util pretty print function 2023-03-27 09:24:22 +08:00
Qirui
ddc13e983b Chore: add selector labels tweak function 2023-03-22 11:02:25 +08:00
Qirui
4cab11f26f Chore: add persistent volume claim retention policy tweak function 2023-03-22 11:02:01 +08:00
Qirui
ba9dfe686f Chore: add persistent volume claim template tweak function 2023-03-22 11:01:37 +08:00
Qirui
f97d3cf748 Chore: add rolling update max unavailable type tweak function 2023-03-22 11:01:25 +08:00
Qirui
1b17b4fa79 Chore: add rolling update partition type tweak function 2023-03-22 11:01:04 +08:00
Qirui
f3ffeae426 Chore: add update strategy type tweak function 2023-03-22 11:00:46 +08:00
Qirui
5e0161b3de Chore: add labels tweak function 2023-03-22 11:00:25 +08:00
Qirui
ec34891782 Chore: add annotation tweak function 2023-03-22 10:51:54 +08:00
Qirui
b907d5af49 Chore: add finalizers tweak function 2023-03-22 10:51:41 +08:00
Qirui
18ba7c0e43 Chore: add ordinal start tweak function 2023-03-22 10:51:18 +08:00
Qirui
3eb34d8b6c Chore: add min ready seconds tweak function 2023-03-22 10:51:03 +08:00
Qirui
2161d095fa Chore: add template restart policy tweak function 2023-03-22 10:50:42 +08:00
Qirui
4418a9f590 Chore: add replicas tweak function 2023-03-22 10:49:51 +08:00
Qirui
7fc08e0ce7 Chore: add pod management policy tweak function 2023-03-22 10:48:29 +08:00
Qirui
77c7d6efcf Chore: add basic make function for stateful set
Add name and namespace tweak functions
2023-03-22 10:47:43 +08:00
Kubernetes Prow Robot
c47d2ae648
Merge pull request #116561 from mattcary/ss-v1beta1-defaulter
StatefulSet v1beta1 defaulter tests
2023-03-14 12:38:34 -07:00
Matthew Cary
d6d19a290d Simplify statefulset fuzzer
Change-Id: I5d583f134d47d615fb2fe44b48bb091ea14fe540
2023-03-14 10:31:49 -07:00
Jordan Liggitt
f7ab379489
Fix StatefulSet fuzzer 2023-03-14 01:19:12 -04:00
Matthew Cary
74b8fc7534 Add statefulsets to v1beta1 default_test
Change-Id: Id68cdb2c9bb7b4ebe21597ead1926e02e3b491af
2023-03-13 20:35:00 -07:00
Matthew Cary
1d6df8233c Graduate StatefulSetAutoDelete to beta
Change-Id: Iee385580d313c69fbb8a893eb5c165aa0b75725d
2023-03-13 17:09:29 -07:00
Kubernetes Prow Robot
8fbfbd9653
Merge pull request #115260 from pwschuurman/kep-3335-statefulset-start-ordinal-beta
Move StatefulSetStartOrdinal feature gate to beta
2023-03-09 21:34:30 -08:00
Kubernetes Prow Robot
48e4052fc0
Merge pull request #114902 from TommyStarK/pkg-apis/replace-deprecated-pointer-function
pkg/apis: Replace deprecated pointer function
2023-03-09 21:34:15 -08:00
Peter Schuurman
910ce0ed0b Run ./hack/update-* scripts to update generated files 2023-03-06 16:38:52 -08:00
Kubernetes Prow Robot
35f0507dca
Merge pull request #111856 from mengjiao-liu/improve-podSpec.restartPpolicy-description
Improve spec.template.spec.restartPolicy description
2023-02-27 22:53:27 -08:00
Mengjiao Liu
81aefe5fee Improve spec.template.spec.restartPolicy description 2023-02-27 14:25:48 +08:00
Peter Schuurman
a714e9e485 Fix validation.go to validate without StatefulSetStartOrdinal feature gate check. Adds test case to validate regression fix of validation failing when spec.ordinals set and feature gate disabled 2023-02-23 16:22:56 -08:00
TommyStarK
c242e647ae pkg/apis: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-08 13:14:37 +01:00
Tim Hockin
c5c58eb653
StatefulSet validation needs to allow old names
A recent commit changed name validation from DNS Subdomain to DNS Label.
The assumption was that a subdomain-named SS could never work and the
only reasonable thing to do would be to delete it.  But if there is a
finalizer, the delete is not possible because we would reject the update
because the old name (subdomain) did not pass the new validation.

This commit does not re-validate the ObjectMeta on update.  Probably
every resource should follow this pattern, but mostly it's a non-issue
becauase the above change (name validation) is not something we do -
this case was excpetional.
2022-12-15 09:33:47 -08:00
Tim Hockin
f4c1682fb1
Validate StatefulSet names as DNS Label
Any StatefuleSet which took advantage of this (by having dots in the
name) can't have worked because we set `pod.spec.hostname` from it,
which is validated as a DNS label.

So while this is strictly a breaking change, it doesn't break anything
that was not already broken.
2022-11-28 17:31:08 -08:00
Peter Schuurman
67425594f3 Rebasing feature branch 2022-11-08 07:48:10 -08:00
Peter Schuurman
366997951b Update doc comments and change name of feature gate 2022-11-08 07:48:10 -08:00
Peter Schuurman
8a9c126eca Small updates and comment fixes 2022-11-08 07:48:09 -08:00
Peter Schuurman
af58b491ef Update generated protobuf files 2022-11-08 07:48:09 -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