Add PreemptionPolicy field to PodGroup

Kubernetes-commit: d2842d8f03bf0c1568efdf19aeee1c505954d42b
This commit is contained in:
Ania Borowiec
2026-06-30 11:10:59 +00:00
committed by Kubernetes Publisher
parent 6059079a91
commit b557eb197f
2 changed files with 22 additions and 0 deletions

View File

@@ -14839,6 +14839,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: podGroupTemplateRef
type:
namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference
- name: preemptionPolicy
type:
scalar: string
- name: priority
type:
scalar: numeric

View File

@@ -18,6 +18,10 @@ limitations under the License.
package v1alpha3
import (
schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3"
)
// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use
// with apply.
//
@@ -64,6 +68,13 @@ type PodGroupSpecApplyConfiguration struct {
// The higher the value, the higher the priority.
// This field is immutable.
Priority *int32 `json:"priority,omitempty"`
// PreemptionPolicy is the Policy for preempting pods/podgroups with lower priority.
// One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.
// When Priority Admission Controller is enabled, it populates this field from PriorityClassName,
// and defaults to PreemptLowerPriority if value is unset in PriorityClass.
// This field is immutable.
// This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.
PreemptionPolicy *schedulingv1alpha3.PreemptionPolicy `json:"preemptionPolicy,omitempty"`
}
// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with
@@ -132,3 +143,11 @@ func (b *PodGroupSpecApplyConfiguration) WithPriority(value int32) *PodGroupSpec
b.Priority = &value
return b
}
// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PreemptionPolicy field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithPreemptionPolicy(value schedulingv1alpha3.PreemptionPolicy) *PodGroupSpecApplyConfiguration {
b.PreemptionPolicy = &value
return b
}