- Add feature gate to control mutable pod resources for suspended jobs
- Implement validatePodResourceUpdatesOnly function to allow only container resource updates
- Allow resource updates for suspended jobs regardless of whether they have started
- Add comprehensive unit and integration tests for all scenarios including started-then-suspended
- Ensure backward compatibility when feature gate is disabled
This enables users to update container resources on suspended jobs, including jobs that
have previously started and been suspended, while maintaining immutability for all other
pod template fields.
* feat(apis/batch): PodFailurePolicyOnPodConditionsPattern.Status can be omitted
Signed-off-by: Harry Li <bertram_li@163.com>
* chore: update generated files after API changes
---------
Signed-off-by: Harry Li <bertram_li@163.com>
Co-authored-by: Harry Li <bertram_li@163.com>
* Add FileKeyRef field and struct to the Pod API
* Add the implementation code in the kubelet.
* Add validation code
* Add basic functionality e2e tests
* add codes for drop disabled pod fields
* update go.mod
Notes:
* For types that define String() - should we prefer that or JSON?
* metav1.Time has a MarshalJSON() and inhereits a String() and they are
different
* Since validation runs on internal types, we still get some GoNames
instead of goNames.
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.
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".
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>
* 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