Commit Graph

4084 Commits

Author SHA1 Message Date
Anish Shah
3b91edb660 unit tests to ensure pod metadata cannot be updated during resize. 2024-11-06 01:33:15 +00:00
Kubernetes Prow Robot
f81a68f488 Merge pull request #128377 from tallclair/allocated-status-2
[FG:InPlacePodVerticalScaling] Implement AllocatedResources status changes for Beta
2024-11-05 23:21:49 +00:00
Kubernetes Prow Robot
2d6c8a129d Merge pull request #127134 from jpbetz/mutating-admission
KEP-3962: MutatingAdmissionPolicy Alpha
2024-11-05 17:31:38 +00:00
Joe Betz
3a1733f302 Add MutatingAdmissionPolicy API
This is closely aligned with ValidatingAdmissionPolicy
except that instead of validations that can fail with
messages, there are mutations, which can be defined
either with as an ApplyConfiguration or JSONPatch.

Co-authored-by: cici37 <cicih@google.com>
2024-11-04 21:40:38 -05:00
Kubernetes Prow Robot
9fe41b6198 Merge pull request #128046 from AxeZhan/ga3960
Graduate PodLifecycleSleepAction to GA
2024-11-04 22:09:35 +00:00
AxeZhan
200a61b6b9 Graduate PodLifecycleSleepAction to GA 2024-11-02 11:05:36 +08:00
Tim Allclair
99dcf07e21 If ResourceRequirements changed, always mark a proposed resize 2024-11-01 14:10:12 -07:00
Tim Allclair
0f0e27d226 Move container status AllocatedResources behind a separate feature gate 2024-11-01 14:02:58 -07:00
Jan Safranek
6ca7b959e4 Add SELinuxChangePolicy validation 2024-11-01 12:46:34 +01:00
Kubernetes Prow Robot
b337f048db Merge pull request #127094 from sreeram-venkitesh/4818-allow-zero-for-prestop-hook
KEP-4818: Relaxed validation for allowing zero in PreStop hook sleep action
2024-10-31 20:25:26 +00:00
zhifei92
5c01709387 Fix the apiserver panic caused by adding a container when updating a pod
add unit test

refactor:  Merge the test cases into TestMarkPodProposedForResize.

chore:  Add the comment and fix the test names
2024-10-29 10:52:46 +08:00
AxeZhan
2ffb568540 rename functions 2024-10-25 12:53:24 +08:00
AxeZhan
9fe847482d move functions 2024-10-25 10:45:28 +08:00
Sreeram Venkitesh
f1f9e7b398 Clean kube_features.go
Added tests, info about new feature gate in error message, fixes from review

Added basic e2e test

Added unit tests

Ran hack/update-featuregates.sh

Tolerate updates to existing resources after disabling feature gate

Added feature gate to versioned_kube_features.go

Fixed existing tests

Use PodValidationOptions for validation instead of using feature gate directly

Relaxed validation for allowing zero in prestop hook sleep action
2024-10-18 22:04:42 +05:30
Kubernetes Prow Robot
4812ea8aa5 Merge pull request #125570 from sanchezl/test-additional-types
KEP-4222: Cover aggregator and apiextension types in unstructured roundtrip test.
2024-10-12 03:18:20 +01:00
Luis Sanchez
aaa7364f60 cover additional types in unstructured roundtrip test
Co-authored-by: Ben Luddy <bluddy@redhat.com>
2024-10-11 16:07:39 -04:00
joey
6bce72a794 fix eps named ports does not work in sidecar(initContainer with restartPolicy=Always)
Signed-off-by: joey <zchengjoey@gmail.com>
2024-10-11 17:53:17 +08:00
Stephen Kitt
ff3e9ea79f pkg/api(s): drop pointer wrapper functions
The new k8s.io/utils/ptr package provides generic wrapper functions,
which can be used instead of type-specific pointer wrapper functions.
This replaces the latter with the former, and migrates other uses of
the deprecated pointer package to ptr in affacted files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-09-23 23:00:34 +02:00
Kubernetes Prow Robot
f9a57ba82d Merge pull request #126760 from ncdc/ncdc/emeritus
Move ncdc to emeritus
2024-09-20 21:01:58 +01:00
Kubernetes Prow Robot
767d28dcf0 Merge pull request #126083 from mmorel-35/testifylint/pkg/api
fix: enable testifylint on `pkg/api`
2024-09-20 05:44:52 +01:00
carlory
684fbd6f20 remove AllowImageVolumeSource 2024-09-13 23:45:42 +08:00
carlory
24a50a3ddf If old pod spec has used image volume source, we must allow it 2024-09-13 23:42:21 +08:00
Adrian Moisey
8e3adc4df6 KEP-4427 : AllowRelaxedDNSSearchValidation (#127167)
* KEP-4427 : AllowRelaxedDNSSearchValidation

* Add e2e test with feature gate to test KEP-4427 RelaxedDNSSearchValidation

* Add more validatePodDNSConfig test cases

Also update Regex to match the case we want.

Thanks Tim and Antonio!
2024-09-12 09:41:19 +01:00
Andy Goldstein
0e228be96f Use emeritus_*
Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2024-08-22 17:48:27 -04:00
Andy Goldstein
3ab816dcab Move ncdc to emeritus
I am moving myself to emeritus as I am now firmly on the end-user side
of things.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2024-08-17 13:06:45 -04:00
Sergey Kanzhelev
62f96d2748 set AllocatedResourcesStatus in the Pod Status 2024-07-24 00:29:35 +00:00
Sergey Kanzhelev
3790ee2fe8 reset fields when the feature gate was not set 2024-07-24 00:29:35 +00:00
Kubernetes Prow Robot
107f621462 Merge pull request #126108 from gnufied/changes-volume-recovery
Reduce state changes when expansion fails and mark certain failures as infeasible
2024-07-23 13:30:56 -07:00
Kubernetes Prow Robot
13d9d7c689 Merge pull request #124819 from carlory/add-warning-MountOptionAnnotation
mark volume.beta.kubernetes.io/mount-options as deprecated
2024-07-23 12:21:11 -07:00
Kubernetes Prow Robot
7590cb7adf Merge pull request #125257 from vinayakankugoyal/armor
KEP-24: Update AppArmor feature gates to GA stage.
2024-07-23 09:20:52 -07:00
Patrick Ohly
91d7882e86 DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key
differences:
- refocused on structured parameters and allocating devices
- support for constraints across devices
- support for allocating "all" or a fixed amount
  of similar devices in a single request
- no class for ResourceClaims, instead individual
  device requests are associated with a mandatory
  DeviceClass

For the sake of simplicity, optional basic types (ints, strings) where the null
value is the default are represented as values in the API types. This makes Go
code simpler because it doesn't have to check for nil (consumers) and values
can be set directly (producers). The effect is that in protobuf, these fields
always get encoded because `opt` only has an effect for pointers.

The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new
"request" field. This is considered acceptable because the entire `claims`
field in the pod spec is still alpha.

The implementation is complete enough to bring up the apiserver.
Adapting other components follows.
2024-07-22 18:09:34 +02:00
Patrick Ohly
62d21589ef api test: update TestDefaulting
Logging and sub-tests were added to help debug this problem:
the test passes for ResourceClaim (same defaulting!) and fails
for the list, but only if run together with the other test cases?!

    $ go test ./pkg/api/testing
    --- FAIL: TestDefaulting (1.76s)
        --- FAIL: TestDefaulting/resource.k8s.io/v1alpha3,_Kind=ResourceClaimList (0.01s)
            defaulting_test.go:238: expected resource.k8s.io/v1alpha3, Kind=ResourceClaimList to trigger defaulting due to fuzzing
    FAIL
    FAIL	k8s.io/kubernetes/pkg/api/testing	17.294s
    FAIL
    $ go test -run=TestDefaulting/resource.k8s.io/v1alpha3,_Kind=ResourceClaimList ./pkg/api/testing
    ok  	k8s.io/kubernetes/pkg/api/testing	0.062s

What fixed that problem was increasing the likelihood of generating the right
test object by iterating more often before giving up.
2024-07-21 17:28:14 +02:00
Patrick Ohly
de5742ae83 DRA: remove immediate allocation
As agreed in https://github.com/kubernetes/enhancements/pull/4709, immediate
allocation is one of those features which can be removed because it makes no
sense for structured parameters and the justification for classic DRA is weak.
2024-07-21 17:28:14 +02:00
Patrick Ohly
b51d68bb87 DRA: bump API v1alpha2 -> v1alpha3
This is in preparation for revamping the resource.k8s.io completely. Because
there will be no support for transitioning from v1alpha2 to v1alpha3, the
roundtrip test data for that API in 1.29 and 1.30 gets removed.

Repeating the version in the import name of the API packages is not really
required. It was done for a while to support simpler grepping for usage of
alpha APIs, but there are better ways for that now. So during this transition,
"resourceapi" gets used instead of "resourcev1alpha3" and the version gets
dropped from informer and lister imports. The advantage is that the next bump
to v1beta1 will affect fewer source code lines.

Only source code where the version really matters (like API registration)
retains the versioned import.
2024-07-21 17:28:13 +02:00
Kubernetes Prow Robot
8527092e02 Merge pull request #119024 from wafuwafu13/deprecated-node-label
chore(node/util): add more labels to `deprecatedNodeLabels`
2024-07-20 11:31:40 -07:00
Matthieu MOREL
2a7b71fe01 fix: enable testifylint on pkg/api 2024-07-19 22:40:33 +00:00
Sascha Grunert
f7ca3131e0 Add ImageVolumeSource API
Adding the required Kubernetes API so that the kubelet can start using
it. This patch also adds the corresponding alpha feature gate as
outlined in KEP 4639.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-07-18 17:25:54 +02:00
Vinayak Goyal
bc06071495 Update AppArmor feature gates to GA stage.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2024-07-15 23:29:37 +00:00
Hemant Kumar
ad28dfb42e Fix code that uses old values for resize errors 2024-07-12 14:37:35 -04:00
Kubernetes Prow Robot
1080554307 Merge pull request #124969 from RomanBednar/pv-phase-transition-time-ga
graduate PersistentVolumeLastPhaseTransitionTime to GA in 1.31
2024-07-11 15:29:19 -07:00
Ben Luddy
4755e1f859 Automatically transcode RawExtension between unstructured protocols. 2024-07-09 17:02:34 -04:00
Kubernetes Prow Robot
53c8efbe71 Merge pull request #125743 from benluddy/extract-roundtrip-to-unstructured
Extract RoundtripToUnstructured to apimachinery apitesting library.
2024-07-08 08:22:49 -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
Kubernetes Prow Robot
93d56511e6 Merge pull request #125021 from aojea/servicecidrbeta
KEP-1880 Multiple Service CIDRs: Graduate to Beta (2/2)
2024-06-30 08:53:25 -07:00
Antonio Ojea
0e1f9dadd6 modify components to use the networking v1beta1 API 2024-06-30 09:48:46 +00: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
Kubernetes Prow Robot
ac9aec9f9b Merge pull request #125116 from pohly/dra-one-of-source
DRA: remove "source" indirection from v1 Pod API
2024-06-28 12:46:45 -07:00
Patrick Ohly
bde9b64cdf DRA: remove "source" indirection from v1 Pod API
This makes the API nicer:

    resourceClaims:
    - name: with-template
      resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      resourceClaimName: test-shared-claim

Previously, this was:

    resourceClaims:
    - name: with-template
      source:
        resourceClaimTemplateName: test-inline-claim-template
    - name: with-claim
      source:
        resourceClaimName: test-shared-claim

A more long-term benefit is that other, future alternatives
might not make sense under the "source" umbrella.

This is a breaking change. It's justified because DRA is still
alpha and will have several other API breaks in 1.31.
2024-06-27 17:53:24 +02:00
Antonio Ojea
b04ca186d8 replace the iptree on the ipallocator
ServiceCIDRs are protected by finalizers and the CIDRs fields are
inmutable once set, only the readiness state impact the allocator
as it can only allocate IPs if any of the ServiceCIDR is ready.

The Add/Update events triggers a reconcilation of the current state
of the ServiceCIDR present in the informers with the existing IP
allocators.

The Delete events are handled directly to update or delete the
corresponing IP allocator.
2024-06-27 11:33:36 +00:00
Antonio Ojea
b5cfccbca7 replace iptree on the servicecidr controller 2024-06-27 11:33:36 +00:00