Commit Graph

423 Commits

Author SHA1 Message Date
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
Kubernetes Prow Robot
86b99869cb Merge pull request #128299 from SergeyKanzhelev/updateDHS
Update Device Health fields description for KEP-4680
2024-10-28 22:19:01 +00:00
Sergey Kanzhelev
5cfaf47448 update allocated resources status validation to account for claims 2024-10-26 07:11:06 +00:00
Kubernetes Prow Robot
0a62f0fd7b Merge pull request #128139 from Jefftree/revert-allowservicelb
Revert removal of feature AllowServiceLBStatusOnNonLB and LockToDefault first
2024-10-24 15:20:54 +01: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
Robbie Cronin
cdbfbde4aa Add ut coverage for capabilities.Setup (#125395)
* Add ut coverage for capabilities.Setup

* Update pkg/capabilities/capabilities_test.go

Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>

* Add ut coverage for capabilities.Setup

Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>

---------

Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2024-10-17 18:23:03 +01:00
Kubernetes Prow Robot
c6ad6fa951 Merge pull request #125477 from my-git9/namespaceformat
Modify some error words
2024-10-17 17:17:17 +01:00
Jefftree
06321f4a0e Revert "Remove AllowServiceLBStatusOnNonLB gate"
This reverts commit 128e189fcd.
2024-10-16 18:00:42 -04:00
Aohan Yang
da5738d9aa Set feature gate emulation version during test 2024-10-10 19:26:31 +08:00
Matthieu MOREL
b7248077a9 fix: enable formatter rule from testifylint in module k8s.io/kubernetes
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 08:19:54 +02:00
carlory
684fbd6f20 remove AllowImageVolumeSource 2024-09-13 23:45:42 +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
Tim Hockin
128e189fcd Remove AllowServiceLBStatusOnNonLB gate 2024-08-21 13:07:52 -07: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
05bb5f71f8 Merge pull request #120611 from pohly/dra-resource-quotas
DRA: resource quotas
2024-07-23 12:20:44 -07:00
Kubernetes Prow Robot
a00181d4d4 Merge pull request #121902 from carlory/kep-3751-pv-controller
[kep-3751] pvc bind pv with vac
2024-07-23 11:02:13 -07:00
Patrick Ohly
1f43a80b3c DRA quota: unit test case for resource.k8s.io quota names
The names aren't actually special for validation. They are
acceptable with and without the feature gate, the only difference
is that they don't do anything when the feature is enabled.
2024-07-23 18:52:33 +02:00
carlory
3a6a4830df pvc bind pv with vac 2024-07-23 15:04:11 +08:00
Kubernetes Prow Robot
d21b17264e Merge pull request #125488 from pohly/dra-1.31
DRA for 1.31
2024-07-22 11:45:55 -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
Kubernetes Prow Robot
3f933ef262 Merge pull request #124053 from PichuChen/patch-1
Fix a typo
2024-07-22 08:01:40 -07: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
Hemant Kumar
49e82fd120 Rename ReizeFailed conditions to ResizeInfeasible 2024-07-10 12:02:54 -04: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
Patrick Ohly
8e37501cd4 api: remove obsolete validation of deterministic claim name
When replacing the deterministic ResourceClaim name with a generated one this
particular piece of the original validation was incorrectly left in place.
It's not required anymore that "<pod name>-<claim name in pod spec>" is a valid
ResourceClaim name.
2024-06-28 20:38:50 +02: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
Pichu Chen
6d45005fde Fix a typo. 2024-06-24 20:47:14 +08:00
xin.li
c3832428b6 Modify some error words
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-06-13 13:13:29 +08:00
Shingo Omura
552fd7e850 KEP-3619: Fine-grained SupplementalGroups control (#117842)
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api

* Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate

* Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields

* Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet

* Clarify `SupplementalGroupsPolicy` is an OS depdendent field.

* Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus

It is because, the process identity can be dynamic if the initially attached identity
has enough privilege calling setuid/setgid/setgroups syscalls in Linux.

* Rewording suggestion applied

* Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34

* Added validations for SupplementalGroupsPolicy and ContainerUser

* No need featuregate check in validation when adding new field with no default value

* fix typo: identitiy -> identity
2024-05-29 15:40:29 -07: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
Akihiro Suda
8db07446f1 api: validate RecursiveReadOnlyMounts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-10 02:59:30 +09:00
Kubernetes Prow Robot
9ad2aabc64 Merge pull request #123520 from haircommander/proc-mount-rely-userns-2
KEP-4265: Update Unmasked ProcMountType to fail validation without a pod level user namespace
2024-03-07 18:21:08 -08:00
Peter Hunt
23706cb90c api validation: validate proc mount against user namespace
fail if container uses proc mount unmasked but pod does not use user namespace

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-03-07 15:56:06 -05:00
HirazawaUi
2867be47b3 followup to allow special characters 2024-03-08 00:08:43 +08:00
Kubernetes Prow Robot
bd25605619 Merge pull request #123435 from tallclair/apparmor-ga
AppArmor fields API
2024-03-06 15:35:14 -08:00
Tim Allclair
06caf32ecd Validate localhost profile max length 2024-03-06 10:46:31 -08:00
Tim Allclair
0eb5f52d06 Rename AppArmor annotation constants with Deprecated 2024-03-06 10:46:31 -08:00
Kubernetes Prow Robot
87f9b3891e Merge pull request #123385 from HirazawaUi/allow-special-characters
Allow almost all printable ASCII characters in environment variables
2024-03-05 17:31:06 -08:00
Tim Allclair
ec325b328d Match annotations against pod AppArmor field 2024-03-05 12:22:50 -08:00
Tim Allclair
289ec02e8b Implement version skew strategy 2024-03-05 12:22:50 -08:00
Tim Allclair
94927afb50 AppArmor API changes 2024-03-05 12:02:43 -08:00
HirazawaUi
e56240b2e1 add validation method at the top level 2024-03-05 17:09:10 +08:00
Kubernetes Prow Robot
a76a3e031f Merge pull request #123487 from gauravkghildiyal/kep-4444
Introduce trafficDistribution field for Kubernetes Services
2024-03-04 20:07:15 -08:00
Kubernetes Prow Robot
e4ee7b005c Merge pull request #123323 from gjkim42/add-ValidateInitContainerStateTransition
Validate restartable init container state transition
2024-03-04 16:21:30 -08:00
Gaurav Ghildiyal
996d11d4e8 Add new field trafficDistribution to Service spec 2024-03-03 22:34:17 -08:00