api: regenerate files for WorkloadRef changes

This commit is contained in:
dom4ha
2026-07-01 13:16:05 +00:00
parent 24ac5b2bd7
commit af1d59c804
22 changed files with 222 additions and 635 deletions

View File

@@ -19712,10 +19712,6 @@
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha3.DisruptionMode",
"description": "DisruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable."
},
"podGroupTemplateRef": {
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference",
"description": "PodGroupTemplateRef references an optional PodGroup template within other object (e.g. Workload) that was used to create the PodGroup. This field is immutable."
},
"preemptionPolicy": {
"description": "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.",
"type": "string"
@@ -19749,6 +19745,10 @@
"schedulingPolicy": {
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy",
"description": "SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate."
},
"workloadRef": {
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha3.WorkloadReference",
"description": "WorkloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable."
}
},
"required": [
@@ -19836,23 +19836,6 @@
],
"type": "object"
},
"io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference": {
"description": "PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). Exactly one reference must be set.",
"properties": {
"workload": {
"$ref": "#/definitions/io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference",
"description": "Workload references the PodGroupTemplate within the Workload object that was used to create the PodGroup."
}
},
"type": "object",
"x-kubernetes-unions": [
{
"fields-to-discriminateBy": {
"workload": "Workload"
}
}
]
},
"io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode": {
"description": "SingleDisruptionMode specifies that children can be disrupted independently.",
"type": "object"
@@ -19959,21 +19942,21 @@
}
]
},
"io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference": {
"description": "WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.",
"io.k8s.api.scheduling.v1alpha3.WorkloadReference": {
"description": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.",
"properties": {
"podGroupTemplateName": {
"description": "PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.",
"templateName": {
"description": "TemplateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.",
"type": "string"
},
"workloadName": {
"description": "WorkloadName defines the name of the Workload object.",
"description": "WorkloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.",
"type": "string"
}
},
"required": [
"workloadName",
"podGroupTemplateName"
"templateName"
],
"type": "object"
},

View File

@@ -243,14 +243,6 @@
},
"description": "DisruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable."
},
"podGroupTemplateRef": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference"
}
],
"description": "PodGroupTemplateRef references an optional PodGroup template within other object (e.g. Workload) that was used to create the PodGroup. This field is immutable."
},
"preemptionPolicy": {
"description": "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.",
"type": "string"
@@ -293,6 +285,14 @@
],
"default": {},
"description": "SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate."
},
"workloadRef": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.scheduling.v1alpha3.WorkloadReference"
}
],
"description": "WorkloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable."
}
},
"required": [
@@ -394,27 +394,6 @@
],
"type": "object"
},
"io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference": {
"description": "PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). Exactly one reference must be set.",
"properties": {
"workload": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference"
}
],
"description": "Workload references the PodGroupTemplate within the Workload object that was used to create the PodGroup."
}
},
"type": "object",
"x-kubernetes-unions": [
{
"fields-to-discriminateBy": {
"workload": "Workload"
}
}
]
},
"io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode": {
"description": "SingleDisruptionMode specifies that children can be disrupted independently.",
"type": "object"
@@ -539,23 +518,23 @@
}
]
},
"io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference": {
"description": "WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.",
"io.k8s.api.scheduling.v1alpha3.WorkloadReference": {
"description": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.",
"properties": {
"podGroupTemplateName": {
"templateName": {
"default": "",
"description": "PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.",
"description": "TemplateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.",
"type": "string"
},
"workloadName": {
"default": "",
"description": "WorkloadName defines the name of the Workload object.",
"description": "WorkloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.",
"type": "string"
}
},
"required": [
"workloadName",
"podGroupTemplateName"
"templateName"
],
"type": "object"
},

View File

@@ -167,16 +167,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*schedulingv1alpha3.PodGroupTemplateReference)(nil), (*scheduling.PodGroupTemplateReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_PodGroupTemplateReference_To_scheduling_PodGroupTemplateReference(a.(*schedulingv1alpha3.PodGroupTemplateReference), b.(*scheduling.PodGroupTemplateReference), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*scheduling.PodGroupTemplateReference)(nil), (*schedulingv1alpha3.PodGroupTemplateReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_scheduling_PodGroupTemplateReference_To_v1alpha3_PodGroupTemplateReference(a.(*scheduling.PodGroupTemplateReference), b.(*schedulingv1alpha3.PodGroupTemplateReference), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*schedulingv1alpha3.SingleDisruptionMode)(nil), (*scheduling.SingleDisruptionMode)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_SingleDisruptionMode_To_scheduling_SingleDisruptionMode(a.(*schedulingv1alpha3.SingleDisruptionMode), b.(*scheduling.SingleDisruptionMode), scope)
}); err != nil {
@@ -227,13 +217,13 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*schedulingv1alpha3.WorkloadPodGroupTemplateReference)(nil), (*scheduling.WorkloadPodGroupTemplateReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_WorkloadPodGroupTemplateReference_To_scheduling_WorkloadPodGroupTemplateReference(a.(*schedulingv1alpha3.WorkloadPodGroupTemplateReference), b.(*scheduling.WorkloadPodGroupTemplateReference), scope)
if err := s.AddGeneratedConversionFunc((*schedulingv1alpha3.WorkloadReference)(nil), (*scheduling.WorkloadReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_WorkloadReference_To_scheduling_WorkloadReference(a.(*schedulingv1alpha3.WorkloadReference), b.(*scheduling.WorkloadReference), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*scheduling.WorkloadPodGroupTemplateReference)(nil), (*schedulingv1alpha3.WorkloadPodGroupTemplateReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_scheduling_WorkloadPodGroupTemplateReference_To_v1alpha3_WorkloadPodGroupTemplateReference(a.(*scheduling.WorkloadPodGroupTemplateReference), b.(*schedulingv1alpha3.WorkloadPodGroupTemplateReference), scope)
if err := s.AddGeneratedConversionFunc((*scheduling.WorkloadReference)(nil), (*schedulingv1alpha3.WorkloadReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_scheduling_WorkloadReference_To_v1alpha3_WorkloadReference(a.(*scheduling.WorkloadReference), b.(*schedulingv1alpha3.WorkloadReference), scope)
}); err != nil {
return err
}
@@ -524,26 +514,6 @@ func Convert_scheduling_PodGroupTemplate_To_v1alpha3_PodGroupTemplate(in *schedu
return autoConvert_scheduling_PodGroupTemplate_To_v1alpha3_PodGroupTemplate(in, out, s)
}
func autoConvert_v1alpha3_PodGroupTemplateReference_To_scheduling_PodGroupTemplateReference(in *schedulingv1alpha3.PodGroupTemplateReference, out *scheduling.PodGroupTemplateReference, s conversion.Scope) error {
*out = *(*scheduling.PodGroupTemplateReference)(unsafe.Pointer(in))
return nil
}
// Convert_v1alpha3_PodGroupTemplateReference_To_scheduling_PodGroupTemplateReference is an autogenerated conversion function.
func Convert_v1alpha3_PodGroupTemplateReference_To_scheduling_PodGroupTemplateReference(in *schedulingv1alpha3.PodGroupTemplateReference, out *scheduling.PodGroupTemplateReference, s conversion.Scope) error {
return autoConvert_v1alpha3_PodGroupTemplateReference_To_scheduling_PodGroupTemplateReference(in, out, s)
}
func autoConvert_scheduling_PodGroupTemplateReference_To_v1alpha3_PodGroupTemplateReference(in *scheduling.PodGroupTemplateReference, out *schedulingv1alpha3.PodGroupTemplateReference, s conversion.Scope) error {
*out = *(*schedulingv1alpha3.PodGroupTemplateReference)(unsafe.Pointer(in))
return nil
}
// Convert_scheduling_PodGroupTemplateReference_To_v1alpha3_PodGroupTemplateReference is an autogenerated conversion function.
func Convert_scheduling_PodGroupTemplateReference_To_v1alpha3_PodGroupTemplateReference(in *scheduling.PodGroupTemplateReference, out *schedulingv1alpha3.PodGroupTemplateReference, s conversion.Scope) error {
return autoConvert_scheduling_PodGroupTemplateReference_To_v1alpha3_PodGroupTemplateReference(in, out, s)
}
func autoConvert_v1alpha3_SingleDisruptionMode_To_scheduling_SingleDisruptionMode(in *schedulingv1alpha3.SingleDisruptionMode, out *scheduling.SingleDisruptionMode, s conversion.Scope) error {
*out = *(*scheduling.SingleDisruptionMode)(unsafe.Pointer(in))
return nil
@@ -652,24 +622,24 @@ func Convert_scheduling_WorkloadList_To_v1alpha3_WorkloadList(in *scheduling.Wor
return autoConvert_scheduling_WorkloadList_To_v1alpha3_WorkloadList(in, out, s)
}
func autoConvert_v1alpha3_WorkloadPodGroupTemplateReference_To_scheduling_WorkloadPodGroupTemplateReference(in *schedulingv1alpha3.WorkloadPodGroupTemplateReference, out *scheduling.WorkloadPodGroupTemplateReference, s conversion.Scope) error {
*out = *(*scheduling.WorkloadPodGroupTemplateReference)(unsafe.Pointer(in))
func autoConvert_v1alpha3_WorkloadReference_To_scheduling_WorkloadReference(in *schedulingv1alpha3.WorkloadReference, out *scheduling.WorkloadReference, s conversion.Scope) error {
*out = *(*scheduling.WorkloadReference)(unsafe.Pointer(in))
return nil
}
// Convert_v1alpha3_WorkloadPodGroupTemplateReference_To_scheduling_WorkloadPodGroupTemplateReference is an autogenerated conversion function.
func Convert_v1alpha3_WorkloadPodGroupTemplateReference_To_scheduling_WorkloadPodGroupTemplateReference(in *schedulingv1alpha3.WorkloadPodGroupTemplateReference, out *scheduling.WorkloadPodGroupTemplateReference, s conversion.Scope) error {
return autoConvert_v1alpha3_WorkloadPodGroupTemplateReference_To_scheduling_WorkloadPodGroupTemplateReference(in, out, s)
// Convert_v1alpha3_WorkloadReference_To_scheduling_WorkloadReference is an autogenerated conversion function.
func Convert_v1alpha3_WorkloadReference_To_scheduling_WorkloadReference(in *schedulingv1alpha3.WorkloadReference, out *scheduling.WorkloadReference, s conversion.Scope) error {
return autoConvert_v1alpha3_WorkloadReference_To_scheduling_WorkloadReference(in, out, s)
}
func autoConvert_scheduling_WorkloadPodGroupTemplateReference_To_v1alpha3_WorkloadPodGroupTemplateReference(in *scheduling.WorkloadPodGroupTemplateReference, out *schedulingv1alpha3.WorkloadPodGroupTemplateReference, s conversion.Scope) error {
*out = *(*schedulingv1alpha3.WorkloadPodGroupTemplateReference)(unsafe.Pointer(in))
func autoConvert_scheduling_WorkloadReference_To_v1alpha3_WorkloadReference(in *scheduling.WorkloadReference, out *schedulingv1alpha3.WorkloadReference, s conversion.Scope) error {
*out = *(*schedulingv1alpha3.WorkloadReference)(unsafe.Pointer(in))
return nil
}
// Convert_scheduling_WorkloadPodGroupTemplateReference_To_v1alpha3_WorkloadPodGroupTemplateReference is an autogenerated conversion function.
func Convert_scheduling_WorkloadPodGroupTemplateReference_To_v1alpha3_WorkloadPodGroupTemplateReference(in *scheduling.WorkloadPodGroupTemplateReference, out *schedulingv1alpha3.WorkloadPodGroupTemplateReference, s conversion.Scope) error {
return autoConvert_scheduling_WorkloadPodGroupTemplateReference_To_v1alpha3_WorkloadPodGroupTemplateReference(in, out, s)
// Convert_scheduling_WorkloadReference_To_v1alpha3_WorkloadReference is an autogenerated conversion function.
func Convert_scheduling_WorkloadReference_To_v1alpha3_WorkloadReference(in *scheduling.WorkloadReference, out *schedulingv1alpha3.WorkloadReference, s conversion.Scope) error {
return autoConvert_scheduling_WorkloadReference_To_v1alpha3_WorkloadReference(in, out, s)
}
func autoConvert_v1alpha3_WorkloadSpec_To_scheduling_WorkloadSpec(in *schedulingv1alpha3.WorkloadSpec, out *scheduling.WorkloadSpec, s conversion.Scope) error {

View File

@@ -562,14 +562,14 @@ func Validate_PodGroupSpec(
ctx context.Context, op operation.Operation, fldPath *field.Path,
obj, oldObj *schedulingv1alpha3.PodGroupSpec) (errs field.ErrorList) {
{ // field schedulingv1alpha3.PodGroupSpec.PodGroupTemplateRef
{ // field schedulingv1alpha3.PodGroupSpec.WorkloadRef
fn := func(
fldPath *field.Path,
obj, oldObj *schedulingv1alpha3.PodGroupTemplateReference,
obj, oldObj *schedulingv1alpha3.WorkloadReference,
oldValueCorrelated bool) (errs field.ErrorList) {
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update {
if equality.Semantic.DeepEqual(obj, oldObj) {
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
return nil
}
}
@@ -586,14 +586,14 @@ func Validate_PodGroupSpec(
return // do not proceed
}
// call the type's validation function
errs = append(errs, Validate_PodGroupTemplateReference(ctx, op, fldPath, obj, oldObj)...)
errs = append(errs, Validate_WorkloadReference(ctx, op, fldPath, obj, oldObj)...)
return
}
oldVal := safe.Field(oldObj,
func(oldObj *schedulingv1alpha3.PodGroupSpec) *schedulingv1alpha3.PodGroupTemplateReference {
return oldObj.PodGroupTemplateRef
func(oldObj *schedulingv1alpha3.PodGroupSpec) *schedulingv1alpha3.WorkloadReference {
return oldObj.WorkloadRef
})
errs = append(errs, fn(fldPath.Child("podGroupTemplateRef"), obj.PodGroupTemplateRef, oldVal, oldObj != nil)...)
errs = append(errs, fn(fldPath.Child("workloadRef"), obj.WorkloadRef, oldVal, oldObj != nil)...)
}
{ // field schedulingv1alpha3.PodGroupSpec.SchedulingPolicy
@@ -1210,57 +1210,6 @@ func Validate_PodGroupTemplate(
return errs
}
var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupTemplateReference_ = validate.NewUnionMembership(validate.NewUnionMember("workload"))
// Validate_PodGroupTemplateReference validates an instance of PodGroupTemplateReference according
// to declarative validation rules in the API schema.
func Validate_PodGroupTemplateReference(
ctx context.Context, op operation.Operation, fldPath *field.Path,
obj, oldObj *schedulingv1alpha3.PodGroupTemplateReference) (errs field.ErrorList) {
if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupTemplateReference_,
func(obj *schedulingv1alpha3.PodGroupTemplateReference) bool {
if obj == nil {
return false
}
return obj.Workload != nil
}); len(e) != 0 {
errs = append(errs, e...)
}
{ // field schedulingv1alpha3.PodGroupTemplateReference.Workload
fn := func(
fldPath *field.Path,
obj, oldObj *schedulingv1alpha3.WorkloadPodGroupTemplateReference,
oldValueCorrelated bool) (errs field.ErrorList) {
// don't revalidate unchanged data
if oldValueCorrelated && op.Type == operation.Update {
if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) {
return nil
}
}
// call field-attached validations
earlyReturn := false
if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 {
earlyReturn = true
}
if earlyReturn {
return // do not proceed
}
// call the type's validation function
errs = append(errs, Validate_WorkloadPodGroupTemplateReference(ctx, op, fldPath, obj, oldObj)...)
return
}
oldVal := safe.Field(oldObj,
func(oldObj *schedulingv1alpha3.PodGroupTemplateReference) *schedulingv1alpha3.WorkloadPodGroupTemplateReference {
return oldObj.Workload
})
errs = append(errs, fn(fldPath.Child("workload"), obj.Workload, oldVal, oldObj != nil)...)
}
return errs
}
var symbolsForPreemptionPolicy = sets.New(schedulingv1alpha3.PreemptLowerPriority, schedulingv1alpha3.PreemptNever)
// Validate_PreemptionPolicy validates an instance of PreemptionPolicy according
@@ -1455,13 +1404,13 @@ func Validate_Workload(
return errs
}
// Validate_WorkloadPodGroupTemplateReference validates an instance of WorkloadPodGroupTemplateReference according
// Validate_WorkloadReference validates an instance of WorkloadReference according
// to declarative validation rules in the API schema.
func Validate_WorkloadPodGroupTemplateReference(
func Validate_WorkloadReference(
ctx context.Context, op operation.Operation, fldPath *field.Path,
obj, oldObj *schedulingv1alpha3.WorkloadPodGroupTemplateReference) (errs field.ErrorList) {
obj, oldObj *schedulingv1alpha3.WorkloadReference) (errs field.ErrorList) {
{ // field schedulingv1alpha3.WorkloadPodGroupTemplateReference.WorkloadName
{ // field schedulingv1alpha3.WorkloadReference.WorkloadName
fn := func(
fldPath *field.Path,
obj, oldObj *string,
@@ -1487,13 +1436,13 @@ func Validate_WorkloadPodGroupTemplateReference(
return
}
oldVal := safe.Field(oldObj,
func(oldObj *schedulingv1alpha3.WorkloadPodGroupTemplateReference) *string {
func(oldObj *schedulingv1alpha3.WorkloadReference) *string {
return &oldObj.WorkloadName
})
errs = append(errs, fn(fldPath.Child("workloadName"), &obj.WorkloadName, oldVal, oldObj != nil)...)
}
{ // field schedulingv1alpha3.WorkloadPodGroupTemplateReference.PodGroupTemplateName
{ // field schedulingv1alpha3.WorkloadReference.TemplateName
fn := func(
fldPath *field.Path,
obj, oldObj *string,
@@ -1519,10 +1468,10 @@ func Validate_WorkloadPodGroupTemplateReference(
return
}
oldVal := safe.Field(oldObj,
func(oldObj *schedulingv1alpha3.WorkloadPodGroupTemplateReference) *string {
return &oldObj.PodGroupTemplateName
func(oldObj *schedulingv1alpha3.WorkloadReference) *string {
return &oldObj.TemplateName
})
errs = append(errs, fn(fldPath.Child("podGroupTemplateName"), &obj.PodGroupTemplateName, oldVal, oldObj != nil)...)
errs = append(errs, fn(fldPath.Child("templateName"), &obj.TemplateName, oldVal, oldObj != nil)...)
}
return errs

View File

@@ -259,10 +259,10 @@ func (in *PodGroupSchedulingPolicy) DeepCopy() *PodGroupSchedulingPolicy {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) {
*out = *in
if in.PodGroupTemplateRef != nil {
in, out := &in.PodGroupTemplateRef, &out.PodGroupTemplateRef
*out = new(PodGroupTemplateReference)
(*in).DeepCopyInto(*out)
if in.WorkloadRef != nil {
in, out := &in.WorkloadRef, &out.WorkloadRef
*out = new(WorkloadReference)
**out = **in
}
in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy)
if in.SchedulingConstraints != nil {
@@ -374,27 +374,6 @@ func (in *PodGroupTemplate) DeepCopy() *PodGroupTemplate {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodGroupTemplateReference) DeepCopyInto(out *PodGroupTemplateReference) {
*out = *in
if in.Workload != nil {
in, out := &in.Workload, &out.Workload
*out = new(WorkloadPodGroupTemplateReference)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplateReference.
func (in *PodGroupTemplateReference) DeepCopy() *PodGroupTemplateReference {
if in == nil {
return nil
}
out := new(PodGroupTemplateReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PriorityClass) DeepCopyInto(out *PriorityClass) {
*out = *in
@@ -568,17 +547,17 @@ func (in *WorkloadList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkloadPodGroupTemplateReference) DeepCopyInto(out *WorkloadPodGroupTemplateReference) {
func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupTemplateReference.
func (in *WorkloadPodGroupTemplateReference) DeepCopy() *WorkloadPodGroupTemplateReference {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference.
func (in *WorkloadReference) DeepCopy() *WorkloadReference {
if in == nil {
return nil
}
out := new(WorkloadPodGroupTemplateReference)
out := new(WorkloadReference)
in.DeepCopyInto(out)
return out
}

View File

@@ -1154,13 +1154,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
schedulingv1alpha3.PodGroupSpec{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_PodGroupSpec(ref),
schedulingv1alpha3.PodGroupStatus{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_PodGroupStatus(ref),
schedulingv1alpha3.PodGroupTemplate{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_PodGroupTemplate(ref),
schedulingv1alpha3.PodGroupTemplateReference{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_PodGroupTemplateReference(ref),
schedulingv1alpha3.SingleDisruptionMode{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_SingleDisruptionMode(ref),
schedulingv1alpha3.TopologyConstraint{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_TopologyConstraint(ref),
schedulingv1alpha3.TypedLocalObjectReference{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_TypedLocalObjectReference(ref),
schedulingv1alpha3.Workload{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_Workload(ref),
schedulingv1alpha3.WorkloadList{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_WorkloadList(ref),
schedulingv1alpha3.WorkloadPodGroupTemplateReference{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_WorkloadPodGroupTemplateReference(ref),
schedulingv1alpha3.WorkloadReference{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_WorkloadReference(ref),
schedulingv1alpha3.WorkloadSpec{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1alpha3_WorkloadSpec(ref),
schedulingv1beta1.PriorityClass{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1beta1_PriorityClass(ref),
schedulingv1beta1.PriorityClassList{}.OpenAPIModelName(): schema_k8sio_api_scheduling_v1beta1_PriorityClassList(ref),
@@ -54261,10 +54260,10 @@ func schema_k8sio_api_scheduling_v1alpha3_PodGroupSpec(ref common.ReferenceCallb
Description: "PodGroupSpec defines the desired state of a PodGroup.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"podGroupTemplateRef": {
"workloadRef": {
SchemaProps: spec.SchemaProps{
Description: "PodGroupTemplateRef references an optional PodGroup template within other object (e.g. Workload) that was used to create the PodGroup. This field is immutable.",
Ref: ref(schedulingv1alpha3.PodGroupTemplateReference{}.OpenAPIModelName()),
Description: "WorkloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable.",
Ref: ref(schedulingv1alpha3.WorkloadReference{}.OpenAPIModelName()),
},
},
"schedulingPolicy": {
@@ -54337,7 +54336,7 @@ func schema_k8sio_api_scheduling_v1alpha3_PodGroupSpec(ref common.ReferenceCallb
},
},
Dependencies: []string{
schedulingv1alpha3.DisruptionMode{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupResourceClaim{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupSchedulingConstraints{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupSchedulingPolicy{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupTemplateReference{}.OpenAPIModelName()},
schedulingv1alpha3.DisruptionMode{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupResourceClaim{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupSchedulingConstraints{}.OpenAPIModelName(), schedulingv1alpha3.PodGroupSchedulingPolicy{}.OpenAPIModelName(), schedulingv1alpha3.WorkloadReference{}.OpenAPIModelName()},
}
}
@@ -54482,38 +54481,6 @@ func schema_k8sio_api_scheduling_v1alpha3_PodGroupTemplate(ref common.ReferenceC
}
}
func schema_k8sio_api_scheduling_v1alpha3_PodGroupTemplateReference(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). Exactly one reference must be set.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"workload": {
SchemaProps: spec.SchemaProps{
Description: "Workload references the PodGroupTemplate within the Workload object that was used to create the PodGroup.",
Ref: ref(schedulingv1alpha3.WorkloadPodGroupTemplateReference{}.OpenAPIModelName()),
},
},
},
},
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-unions": []interface{}{
map[string]interface{}{
"fields-to-discriminateBy": map[string]interface{}{
"workload": "Workload",
},
},
},
},
},
},
Dependencies: []string{
schedulingv1alpha3.WorkloadPodGroupTemplateReference{}.OpenAPIModelName()},
}
}
func schema_k8sio_api_scheduling_v1alpha3_SingleDisruptionMode(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -54678,31 +54645,31 @@ func schema_k8sio_api_scheduling_v1alpha3_WorkloadList(ref common.ReferenceCallb
}
}
func schema_k8sio_api_scheduling_v1alpha3_WorkloadPodGroupTemplateReference(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_k8sio_api_scheduling_v1alpha3_WorkloadReference(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.",
Description: "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"workloadName": {
SchemaProps: spec.SchemaProps{
Description: "WorkloadName defines the name of the Workload object.",
Description: "WorkloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"podGroupTemplateName": {
"templateName": {
SchemaProps: spec.SchemaProps{
Description: "PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.",
Description: "TemplateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.",
Default: "",
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"workloadName", "podGroupTemplateName"},
Required: []string{"workloadName", "templateName"},
},
},
}

View File

@@ -57,8 +57,6 @@ func (m *PodGroupStatus) Reset() { *m = PodGroupStatus{} }
func (m *PodGroupTemplate) Reset() { *m = PodGroupTemplate{} }
func (m *PodGroupTemplateReference) Reset() { *m = PodGroupTemplateReference{} }
func (m *SingleDisruptionMode) Reset() { *m = SingleDisruptionMode{} }
func (m *TopologyConstraint) Reset() { *m = TopologyConstraint{} }
@@ -69,7 +67,7 @@ func (m *Workload) Reset() { *m = Workload{} }
func (m *WorkloadList) Reset() { *m = WorkloadList{} }
func (m *WorkloadPodGroupTemplateReference) Reset() { *m = WorkloadPodGroupTemplateReference{} }
func (m *WorkloadReference) Reset() { *m = WorkloadReference{} }
func (m *WorkloadSpec) Reset() { *m = WorkloadSpec{} }
@@ -538,9 +536,9 @@ func (m *PodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
}
i--
dAtA[i] = 0x12
if m.PodGroupTemplateRef != nil {
if m.WorkloadRef != nil {
{
size, err := m.PodGroupTemplateRef.MarshalToSizedBuffer(dAtA[:i])
size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -690,41 +688,6 @@ func (m *PodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *PodGroupTemplateReference) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *PodGroupTemplateReference) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *PodGroupTemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Workload != nil {
{
size, err := m.Workload.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenerated(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *SingleDisruptionMode) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -904,7 +867,7 @@ func (m *WorkloadList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *WorkloadPodGroupTemplateReference) Marshal() (dAtA []byte, err error) {
func (m *WorkloadReference) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@@ -914,19 +877,19 @@ func (m *WorkloadPodGroupTemplateReference) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *WorkloadPodGroupTemplateReference) MarshalTo(dAtA []byte) (int, error) {
func (m *WorkloadReference) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *WorkloadPodGroupTemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
func (m *WorkloadReference) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
i -= len(m.PodGroupTemplateName)
copy(dAtA[i:], m.PodGroupTemplateName)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroupTemplateName)))
i -= len(m.TemplateName)
copy(dAtA[i:], m.TemplateName)
i = encodeVarintGenerated(dAtA, i, uint64(len(m.TemplateName)))
i--
dAtA[i] = 0x12
i -= len(m.WorkloadName)
@@ -1146,8 +1109,8 @@ func (m *PodGroupSpec) Size() (n int) {
}
var l int
_ = l
if m.PodGroupTemplateRef != nil {
l = m.PodGroupTemplateRef.Size()
if m.WorkloadRef != nil {
l = m.WorkloadRef.Size()
n += 1 + l + sovGenerated(uint64(l))
}
l = m.SchedulingPolicy.Size()
@@ -1231,19 +1194,6 @@ func (m *PodGroupTemplate) Size() (n int) {
return n
}
func (m *PodGroupTemplateReference) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Workload != nil {
l = m.Workload.Size()
n += 1 + l + sovGenerated(uint64(l))
}
return n
}
func (m *SingleDisruptionMode) Size() (n int) {
if m == nil {
return 0
@@ -1309,7 +1259,7 @@ func (m *WorkloadList) Size() (n int) {
return n
}
func (m *WorkloadPodGroupTemplateReference) Size() (n int) {
func (m *WorkloadReference) Size() (n int) {
if m == nil {
return 0
}
@@ -1317,7 +1267,7 @@ func (m *WorkloadPodGroupTemplateReference) Size() (n int) {
_ = l
l = len(m.WorkloadName)
n += 1 + l + sovGenerated(uint64(l))
l = len(m.PodGroupTemplateName)
l = len(m.TemplateName)
n += 1 + l + sovGenerated(uint64(l))
return n
}
@@ -1473,7 +1423,7 @@ func (this *PodGroupSpec) String() string {
}
repeatedStringForResourceClaims += "}"
s := strings.Join([]string{`&PodGroupSpec{`,
`PodGroupTemplateRef:` + strings.Replace(this.PodGroupTemplateRef.String(), "PodGroupTemplateReference", "PodGroupTemplateReference", 1) + `,`,
`WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`,
`SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`,
`SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`,
`ResourceClaims:` + repeatedStringForResourceClaims + `,`,
@@ -1527,16 +1477,6 @@ func (this *PodGroupTemplate) String() string {
}, "")
return s
}
func (this *PodGroupTemplateReference) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&PodGroupTemplateReference{`,
`Workload:` + strings.Replace(this.Workload.String(), "WorkloadPodGroupTemplateReference", "WorkloadPodGroupTemplateReference", 1) + `,`,
`}`,
}, "")
return s
}
func (this *SingleDisruptionMode) String() string {
if this == nil {
return "nil"
@@ -1595,13 +1535,13 @@ func (this *WorkloadList) String() string {
}, "")
return s
}
func (this *WorkloadPodGroupTemplateReference) String() string {
func (this *WorkloadReference) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&WorkloadPodGroupTemplateReference{`,
s := strings.Join([]string{`&WorkloadReference{`,
`WorkloadName:` + fmt.Sprintf("%v", this.WorkloadName) + `,`,
`PodGroupTemplateName:` + fmt.Sprintf("%v", this.PodGroupTemplateName) + `,`,
`TemplateName:` + fmt.Sprintf("%v", this.TemplateName) + `,`,
`}`,
}, "")
return s
@@ -2687,7 +2627,7 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplateRef", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2714,10 +2654,10 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.PodGroupTemplateRef == nil {
m.PodGroupTemplateRef = &PodGroupTemplateReference{}
if m.WorkloadRef == nil {
m.WorkloadRef = &WorkloadReference{}
}
if err := m.PodGroupTemplateRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -3357,92 +3297,6 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *PodGroupTemplateReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: PodGroupTemplateReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PodGroupTemplateReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Workload", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenerated
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Workload == nil {
m.Workload = &WorkloadPodGroupTemplateReference{}
}
if err := m.Workload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SingleDisruptionMode) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3954,7 +3808,7 @@ func (m *WorkloadList) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error {
func (m *WorkloadReference) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -3977,10 +3831,10 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: WorkloadPodGroupTemplateReference: wiretype end group for non-group")
return fmt.Errorf("proto: WorkloadReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: WorkloadPodGroupTemplateReference: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: WorkloadReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@@ -4017,7 +3871,7 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplateName", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field TemplateName", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -4045,7 +3899,7 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PodGroupTemplateName = string(dAtA[iNdEx:postIndex])
m.TemplateName = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex

View File

@@ -230,13 +230,14 @@ message PodGroupSchedulingPolicy {
// PodGroupSpec defines the desired state of a PodGroup.
message PodGroupSpec {
// PodGroupTemplateRef references an optional PodGroup template within other object
// (e.g. Workload) that was used to create the PodGroup. This field is immutable.
// WorkloadRef references an optional PodGroup template within the Workload
// object that was used to create the PodGroup.
// This field is immutable.
//
// +optional
// +k8s:optional
// +k8s:immutable
optional PodGroupTemplateReference podGroupTemplateRef = 1;
optional WorkloadReference workloadRef = 1;
// SchedulingPolicy defines the scheduling policy for this instance of the PodGroup.
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
@@ -458,19 +459,6 @@ message PodGroupTemplate {
optional int32 priority = 7;
}
// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload).
// Exactly one reference must be set.
// +union
message PodGroupTemplateReference {
// Workload references the PodGroupTemplate within the Workload object that was used to create
// the PodGroup.
//
// +optional
// +k8s:optional
// +k8s:unionMember
optional WorkloadPodGroupTemplateReference workload = 1;
}
// SingleDisruptionMode specifies that children can be disrupted independently.
message SingleDisruptionMode {
}
@@ -545,21 +533,27 @@ message WorkloadList {
repeated Workload items = 2;
}
// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.
message WorkloadPodGroupTemplateReference {
// WorkloadName defines the name of the Workload object.
// WorkloadReference references the Workload object together with the template
// that was used to create a particular PodGroup.
message WorkloadReference {
// WorkloadName is the name of the Workload object that contains a template
// that was used when creating a pod group. It must
// be a DNS name.
// This field is required.
//
// +required
// +k8s:required
// +k8s:format=k8s-long-name
optional string workloadName = 1;
// PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.
// TemplateName is the name of a template within the Workload object that
// was used to create a pod group. It must be a DNS label.
// This field is required.
//
// +required
// +k8s:required
// +k8s:format=k8s-short-name
optional string podGroupTemplateName = 2;
optional string templateName = 2;
}
// WorkloadSpec defines the desired state of a Workload.

View File

@@ -125,7 +125,7 @@ func (PodGroupSchedulingPolicy) SwaggerDoc() map[string]string {
var map_PodGroupSpec = map[string]string{
"": "PodGroupSpec defines the desired state of a PodGroup.",
"podGroupTemplateRef": "PodGroupTemplateRef references an optional PodGroup template within other object (e.g. Workload) that was used to create the PodGroup. This field is immutable.",
"workloadRef": "WorkloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable.",
"schedulingPolicy": "SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate.",
"schedulingConstraints": "SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.",
"resourceClaims": "ResourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is an alpha-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.",
@@ -164,15 +164,6 @@ func (PodGroupTemplate) SwaggerDoc() map[string]string {
return map_PodGroupTemplate
}
var map_PodGroupTemplateReference = map[string]string{
"": "PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). Exactly one reference must be set.",
"workload": "Workload references the PodGroupTemplate within the Workload object that was used to create the PodGroup.",
}
func (PodGroupTemplateReference) SwaggerDoc() map[string]string {
return map_PodGroupTemplateReference
}
var map_SingleDisruptionMode = map[string]string{
"": "SingleDisruptionMode specifies that children can be disrupted independently.",
}
@@ -221,14 +212,14 @@ func (WorkloadList) SwaggerDoc() map[string]string {
return map_WorkloadList
}
var map_WorkloadPodGroupTemplateReference = map[string]string{
"": "WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.",
"workloadName": "WorkloadName defines the name of the Workload object.",
"podGroupTemplateName": "PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.",
var map_WorkloadReference = map[string]string{
"": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.",
"workloadName": "WorkloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.",
"templateName": "TemplateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.",
}
func (WorkloadPodGroupTemplateReference) SwaggerDoc() map[string]string {
return map_WorkloadPodGroupTemplateReference
func (WorkloadReference) SwaggerDoc() map[string]string {
return map_WorkloadReference
}
var map_WorkloadSpec = map[string]string{

View File

@@ -258,10 +258,10 @@ func (in *PodGroupSchedulingPolicy) DeepCopy() *PodGroupSchedulingPolicy {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) {
*out = *in
if in.PodGroupTemplateRef != nil {
in, out := &in.PodGroupTemplateRef, &out.PodGroupTemplateRef
*out = new(PodGroupTemplateReference)
(*in).DeepCopyInto(*out)
if in.WorkloadRef != nil {
in, out := &in.WorkloadRef, &out.WorkloadRef
*out = new(WorkloadReference)
**out = **in
}
in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy)
if in.SchedulingConstraints != nil {
@@ -373,27 +373,6 @@ func (in *PodGroupTemplate) DeepCopy() *PodGroupTemplate {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodGroupTemplateReference) DeepCopyInto(out *PodGroupTemplateReference) {
*out = *in
if in.Workload != nil {
in, out := &in.Workload, &out.Workload
*out = new(WorkloadPodGroupTemplateReference)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplateReference.
func (in *PodGroupTemplateReference) DeepCopy() *PodGroupTemplateReference {
if in == nil {
return nil
}
out := new(PodGroupTemplateReference)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SingleDisruptionMode) DeepCopyInto(out *SingleDisruptionMode) {
*out = *in
@@ -503,17 +482,17 @@ func (in *WorkloadList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WorkloadPodGroupTemplateReference) DeepCopyInto(out *WorkloadPodGroupTemplateReference) {
func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupTemplateReference.
func (in *WorkloadPodGroupTemplateReference) DeepCopy() *WorkloadPodGroupTemplateReference {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference.
func (in *WorkloadReference) DeepCopy() *WorkloadReference {
if in == nil {
return nil
}
out := new(WorkloadPodGroupTemplateReference)
out := new(WorkloadReference)
in.DeepCopyInto(out)
return out
}

View File

@@ -86,11 +86,6 @@ func (in PodGroupTemplate) OpenAPIModelName() string {
return "io.k8s.api.scheduling.v1alpha3.PodGroupTemplate"
}
// OpenAPIModelName returns the OpenAPI model name for this type.
func (in PodGroupTemplateReference) OpenAPIModelName() string {
return "io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference"
}
// OpenAPIModelName returns the OpenAPI model name for this type.
func (in SingleDisruptionMode) OpenAPIModelName() string {
return "io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode"
@@ -117,8 +112,8 @@ func (in WorkloadList) OpenAPIModelName() string {
}
// OpenAPIModelName returns the OpenAPI model name for this type.
func (in WorkloadPodGroupTemplateReference) OpenAPIModelName() string {
return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference"
func (in WorkloadReference) OpenAPIModelName() string {
return "io.k8s.api.scheduling.v1alpha3.WorkloadReference"
}
// OpenAPIModelName returns the OpenAPI model name for this type.

View File

@@ -44,11 +44,9 @@
]
},
"spec": {
"podGroupTemplateRef": {
"workload": {
"workloadName": "workloadNameValue",
"podGroupTemplateName": "podGroupTemplateNameValue"
}
"workloadRef": {
"workloadName": "workloadNameValue",
"templateName": "templateNameValue"
},
"schedulingPolicy": {
"basic": {},

View File

@@ -36,10 +36,6 @@ spec:
disruptionMode:
all: {}
single: {}
podGroupTemplateRef:
workload:
podGroupTemplateName: podGroupTemplateNameValue
workloadName: workloadNameValue
preemptionPolicy: preemptionPolicyValue
priority: 7
priorityClassName: priorityClassNameValue
@@ -54,6 +50,9 @@ spec:
basic: {}
gang:
minCount: 1
workloadRef:
templateName: templateNameValue
workloadName: workloadNameValue
status:
conditions:
- lastTransitionTime: "2004-01-01T01:01:01Z"

View File

@@ -14836,9 +14836,6 @@ var schemaYAML = typed.YAMLObject(`types:
namedType: io.k8s.api.scheduling.v1alpha3.DisruptionMode
default:
single: {}
- name: podGroupTemplateRef
type:
namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference
- name: preemptionPolicy
type:
scalar: string
@@ -14863,6 +14860,9 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy
default: {}
- name: workloadRef
type:
namedType: io.k8s.api.scheduling.v1alpha3.WorkloadReference
- name: io.k8s.api.scheduling.v1alpha3.PodGroupStatus
map:
fields:
@@ -14913,16 +14913,6 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy
default: {}
- name: io.k8s.api.scheduling.v1alpha3.PodGroupTemplateReference
map:
fields:
- name: workload
type:
namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference
unions:
- fields:
- fieldName: workload
discriminatorValue: Workload
- name: io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode
map:
elementType:
@@ -14973,10 +14963,10 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.scheduling.v1alpha3.WorkloadSpec
default: {}
- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupTemplateReference
- name: io.k8s.api.scheduling.v1alpha3.WorkloadReference
map:
fields:
- name: podGroupTemplateName
- name: templateName
type:
scalar: string
default: ""

View File

@@ -27,9 +27,10 @@ import (
//
// PodGroupSpec defines the desired state of a PodGroup.
type PodGroupSpecApplyConfiguration struct {
// PodGroupTemplateRef references an optional PodGroup template within other object
// (e.g. Workload) that was used to create the PodGroup. This field is immutable.
PodGroupTemplateRef *PodGroupTemplateReferenceApplyConfiguration `json:"podGroupTemplateRef,omitempty"`
// WorkloadRef references an optional PodGroup template within the Workload
// object that was used to create the PodGroup.
// This field is immutable.
WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"`
// SchedulingPolicy defines the scheduling policy for this instance of the PodGroup.
// Controllers are expected to fill this field by copying it from a PodGroupTemplate.
SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"`
@@ -83,11 +84,11 @@ func PodGroupSpec() *PodGroupSpecApplyConfiguration {
return &PodGroupSpecApplyConfiguration{}
}
// WithPodGroupTemplateRef sets the PodGroupTemplateRef field in the declarative configuration to the given value
// WithWorkloadRef sets the WorkloadRef 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 PodGroupTemplateRef field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithPodGroupTemplateRef(value *PodGroupTemplateReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration {
b.PodGroupTemplateRef = value
// If called multiple times, the WorkloadRef field is set to the value of the last call.
func (b *PodGroupSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration {
b.WorkloadRef = value
return b
}

View File

@@ -1,44 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// PodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the PodGroupTemplateReference type for use
// with apply.
//
// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload).
// Exactly one reference must be set.
type PodGroupTemplateReferenceApplyConfiguration struct {
// Workload references the PodGroupTemplate within the Workload object that was used to create
// the PodGroup.
Workload *WorkloadPodGroupTemplateReferenceApplyConfiguration `json:"workload,omitempty"`
}
// PodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the PodGroupTemplateReference type for use with
// apply.
func PodGroupTemplateReference() *PodGroupTemplateReferenceApplyConfiguration {
return &PodGroupTemplateReferenceApplyConfiguration{}
}
// WithWorkload sets the Workload 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 Workload field is set to the value of the last call.
func (b *PodGroupTemplateReferenceApplyConfiguration) WithWorkload(value *WorkloadPodGroupTemplateReferenceApplyConfiguration) *PodGroupTemplateReferenceApplyConfiguration {
b.Workload = value
return b
}

View File

@@ -1,52 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// WorkloadPodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the WorkloadPodGroupTemplateReference type for use
// with apply.
//
// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.
type WorkloadPodGroupTemplateReferenceApplyConfiguration struct {
// WorkloadName defines the name of the Workload object.
WorkloadName *string `json:"workloadName,omitempty"`
// PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.
PodGroupTemplateName *string `json:"podGroupTemplateName,omitempty"`
}
// WorkloadPodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupTemplateReference type for use with
// apply.
func WorkloadPodGroupTemplateReference() *WorkloadPodGroupTemplateReferenceApplyConfiguration {
return &WorkloadPodGroupTemplateReferenceApplyConfiguration{}
}
// WithWorkloadName sets the WorkloadName 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 WorkloadName field is set to the value of the last call.
func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration {
b.WorkloadName = &value
return b
}
// WithPodGroupTemplateName sets the PodGroupTemplateName 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 PodGroupTemplateName field is set to the value of the last call.
func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithPodGroupTemplateName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration {
b.PodGroupTemplateName = &value
return b
}

View File

@@ -0,0 +1,58 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// WorkloadReferenceApplyConfiguration represents a declarative configuration of the WorkloadReference type for use
// with apply.
//
// WorkloadReference references the Workload object together with the template
// that was used to create a particular PodGroup.
type WorkloadReferenceApplyConfiguration struct {
// WorkloadName is the name of the Workload object that contains a template
// that was used when creating a pod group. It must
// be a DNS name.
// This field is required.
WorkloadName *string `json:"workloadName,omitempty"`
// TemplateName is the name of a template within the Workload object that
// was used to create a pod group. It must be a DNS label.
// This field is required.
TemplateName *string `json:"templateName,omitempty"`
}
// WorkloadReferenceApplyConfiguration constructs a declarative configuration of the WorkloadReference type for use with
// apply.
func WorkloadReference() *WorkloadReferenceApplyConfiguration {
return &WorkloadReferenceApplyConfiguration{}
}
// WithWorkloadName sets the WorkloadName 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 WorkloadName field is set to the value of the last call.
func (b *WorkloadReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadReferenceApplyConfiguration {
b.WorkloadName = &value
return b
}
// WithTemplateName sets the TemplateName 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 TemplateName field is set to the value of the last call.
func (b *WorkloadReferenceApplyConfiguration) WithTemplateName(value string) *WorkloadReferenceApplyConfiguration {
b.TemplateName = &value
return b
}

View File

@@ -1862,16 +1862,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsschedulingv1alpha3.PodGroupStatusApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupTemplate"):
return &applyconfigurationsschedulingv1alpha3.PodGroupTemplateApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupTemplateReference"):
return &applyconfigurationsschedulingv1alpha3.PodGroupTemplateReferenceApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("TopologyConstraint"):
return &applyconfigurationsschedulingv1alpha3.TopologyConstraintApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("TypedLocalObjectReference"):
return &applyconfigurationsschedulingv1alpha3.TypedLocalObjectReferenceApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("Workload"):
return &applyconfigurationsschedulingv1alpha3.WorkloadApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupTemplateReference"):
return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupTemplateReferenceApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadReference"):
return &applyconfigurationsschedulingv1alpha3.WorkloadReferenceApplyConfiguration{}
case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadSpec"):
return &applyconfigurationsschedulingv1alpha3.WorkloadSpecApplyConfiguration{}

View File

@@ -83,7 +83,7 @@ func testDeclarativeValidate(t *testing.T, apiVersion string) {
input: mkValidPodGroup(unsetWorkloadRef()),
},
"empty workloadRef": {
input: mkValidPodGroup(setEmptyWorkloadRef()),
input: mkValidPodGroup(setEmptyWorkloadRef()),
expectedErrs: field.ErrorList{
field.Required(field.NewPath("spec", "workloadRef", "workloadName"), ""),
field.Required(field.NewPath("spec", "workloadRef", "templateName"), ""),

View File

@@ -35,18 +35,6 @@ func init() {
{ErrorType: "FieldValueInvalid", Origin: "union"},
{ErrorType: "FieldValueRequired"},
},
"spec.podGroupTemplateRef": {
{ErrorType: "FieldValueInvalid", Origin: "immutable"},
{ErrorType: "FieldValueInvalid", Origin: "union"},
},
"spec.podGroupTemplateRef.workload.podGroupTemplateName": {
{ErrorType: "FieldValueInvalid", Origin: "format=k8s-short-name"},
{ErrorType: "FieldValueRequired"},
},
"spec.podGroupTemplateRef.workload.workloadName": {
{ErrorType: "FieldValueInvalid", Origin: "format=k8s-long-name"},
{ErrorType: "FieldValueRequired"},
},
"spec.preemptionPolicy": {
{ErrorType: "FieldValueForbidden"},
{ErrorType: "FieldValueInvalid", Origin: "immutable"},
@@ -102,6 +90,17 @@ func init() {
{ErrorType: "FieldValueInvalid", Origin: "minimum"},
{ErrorType: "FieldValueRequired"},
},
"spec.workloadRef": {
{ErrorType: "FieldValueInvalid", Origin: "immutable"},
},
"spec.workloadRef.templateName": {
{ErrorType: "FieldValueInvalid", Origin: "format=k8s-short-name"},
{ErrorType: "FieldValueRequired"},
},
"spec.workloadRef.workloadName": {
{ErrorType: "FieldValueInvalid", Origin: "format=k8s-long-name"},
{ErrorType: "FieldValueRequired"},
},
"status.conditions[*]": {
{ErrorType: "FieldValueDuplicate"},
},