Merge pull request #140080 from dom4ha/api-workload-ref

rename PodGroupTemplateRef to WorkloadRef

Kubernetes-commit: bbdae911b89953eb7a229c1b70c660a525a502b2
This commit is contained in:
Kubernetes Publisher
2026-07-01 16:26:27 +00:00
8 changed files with 76 additions and 125 deletions

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{}

2
go.mod
View File

@@ -23,7 +23,7 @@ require (
golang.org/x/time v0.15.0
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
gopkg.in/evanphx/json-patch.v4 v4.13.0
k8s.io/api v0.0.0-20260701165529-d02ab0da4e67
k8s.io/api v0.0.0-20260701165530-9fa1d170fb11
k8s.io/apimachinery v0.0.0-20260701165018-c428e39362be
k8s.io/klog/v2 v2.140.0
k8s.io/kube-openapi v0.0.0-20260618221249-bc653b64f974

4
go.sum
View File

@@ -118,8 +118,8 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20260701165529-d02ab0da4e67 h1:llxCUXaPMfjLMinGrcYkldJBdBdLr91JLTKbOk5Jveg=
k8s.io/api v0.0.0-20260701165529-d02ab0da4e67/go.mod h1:/VjmYY4IB/HirJZVDFdiDdjF2Z3wi8EgL0xOIPVvcAk=
k8s.io/api v0.0.0-20260701165530-9fa1d170fb11 h1:MZjAHyGujKdVOyoET5JJ88DsD/Q6TsyOvZKKsiO0aeM=
k8s.io/api v0.0.0-20260701165530-9fa1d170fb11/go.mod h1:/VjmYY4IB/HirJZVDFdiDdjF2Z3wi8EgL0xOIPVvcAk=
k8s.io/apimachinery v0.0.0-20260701165018-c428e39362be h1:7SYbrGJaF0XgQGQ3jshZvTkgRSC6lTVcnXADtdBSidQ=
k8s.io/apimachinery v0.0.0-20260701165018-c428e39362be/go.mod h1:T9tvL1Yxf+TRVyTz+Q7KtLAncCr9xxxx1zrF6g/QuR0=
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=