mirror of
https://github.com/kubernetes/client-go.git
synced 2026-07-16 00:10:39 +00:00
Add PreemptionPolicy field to PodGroup
Kubernetes-commit: d2842d8f03bf0c1568efdf19aeee1c505954d42b
This commit is contained in:
committed by
Kubernetes Publisher
parent
6059079a91
commit
b557eb197f
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user