diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 929e6c22ee..ea6f3d2148 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -39,6 +39,22 @@ kube::codegen::gen_helpers \ "${TRAINER_ROOT}/pkg/apis" # Generate clients. +externals=( + "sigs.k8s.io/jobset/api/jobset/v1alpha2.JobSetSpec:sigs.k8s.io/jobset/client-go/applyconfiguration/jobset/v1alpha2" + "k8s.io/api/core/v1.EnvVar:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/core/v1.EnvFromSource:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/core/v1.ResourceRequirements:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/core/v1.Toleration:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/core/v1.Volume:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/core/v1.VolumeMount:k8s.io/client-go/applyconfigurations/core/v1" + "k8s.io/api/autoscaling/v2.MetricSpec:k8s.io/client-go/applyconfigurations/autoscaling/v2" +) + +apply_config_externals="${externals[0]}" +for external in "${externals[@]:1}"; do + apply_config_externals="${apply_config_externals},${external}" +done + echo "Generating clients for Kubeflow Trainer" kube::codegen::gen_client \ --boilerplate "${TRAINER_ROOT}/hack/boilerplate/boilerplate.go.txt" \ @@ -46,6 +62,7 @@ kube::codegen::gen_client \ --output-pkg "${TRAINER_PKG}/pkg/client" \ --with-watch \ --with-applyconfig \ + --applyconfig-externals "${apply_config_externals}" \ "${TRAINER_ROOT}/pkg/apis" # Get the kube-openapi binary to generate OpenAPI spec. diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/containeroverride.go b/pkg/client/applyconfiguration/trainer/v1alpha1/containeroverride.go index 95161e0abe..838a13ced7 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/containeroverride.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/containeroverride.go @@ -17,18 +17,18 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // ContainerOverrideApplyConfiguration represents a declarative configuration of the ContainerOverride type for use // with apply. type ContainerOverrideApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Command []string `json:"command,omitempty"` - Args []string `json:"args,omitempty"` - Env []v1.EnvVar `json:"env,omitempty"` - EnvFrom []v1.EnvFromSource `json:"envFrom,omitempty"` - VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` + Name *string `json:"name,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + Env []v1.EnvVarApplyConfiguration `json:"env,omitempty"` + EnvFrom []v1.EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` + VolumeMounts []v1.VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` } // ContainerOverrideApplyConfiguration constructs a declarative configuration of the ContainerOverride type for use with @@ -68,9 +68,12 @@ func (b *ContainerOverrideApplyConfiguration) WithArgs(values ...string) *Contai // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. -func (b *ContainerOverrideApplyConfiguration) WithEnv(values ...v1.EnvVar) *ContainerOverrideApplyConfiguration { +func (b *ContainerOverrideApplyConfiguration) WithEnv(values ...*v1.EnvVarApplyConfiguration) *ContainerOverrideApplyConfiguration { for i := range values { - b.Env = append(b.Env, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) } return b } @@ -78,9 +81,12 @@ func (b *ContainerOverrideApplyConfiguration) WithEnv(values ...v1.EnvVar) *Cont // WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the EnvFrom field. -func (b *ContainerOverrideApplyConfiguration) WithEnvFrom(values ...v1.EnvFromSource) *ContainerOverrideApplyConfiguration { +func (b *ContainerOverrideApplyConfiguration) WithEnvFrom(values ...*v1.EnvFromSourceApplyConfiguration) *ContainerOverrideApplyConfiguration { for i := range values { - b.EnvFrom = append(b.EnvFrom, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnvFrom") + } + b.EnvFrom = append(b.EnvFrom, *values[i]) } return b } @@ -88,9 +94,12 @@ func (b *ContainerOverrideApplyConfiguration) WithEnvFrom(values ...v1.EnvFromSo // WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the VolumeMounts field. -func (b *ContainerOverrideApplyConfiguration) WithVolumeMounts(values ...v1.VolumeMount) *ContainerOverrideApplyConfiguration { +func (b *ContainerOverrideApplyConfiguration) WithVolumeMounts(values ...*v1.VolumeMountApplyConfiguration) *ContainerOverrideApplyConfiguration { for i := range values { - b.VolumeMounts = append(b.VolumeMounts, values[i]) + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) } return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/datasetconfig.go b/pkg/client/applyconfiguration/trainer/v1alpha1/datasetconfig.go index dd4a690200..380019e66f 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/datasetconfig.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/datasetconfig.go @@ -17,15 +17,16 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // DatasetConfigApplyConfiguration represents a declarative configuration of the DatasetConfig type for use // with apply. type DatasetConfigApplyConfiguration struct { - StorageUri *string `json:"storageUri,omitempty"` - Env []v1.EnvVar `json:"env,omitempty"` - SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` + Env []v1.EnvVarApplyConfiguration `json:"env,omitempty"` + SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` } // DatasetConfigApplyConfiguration constructs a declarative configuration of the DatasetConfig type for use with @@ -45,9 +46,12 @@ func (b *DatasetConfigApplyConfiguration) WithStorageUri(value string) *DatasetC // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. -func (b *DatasetConfigApplyConfiguration) WithEnv(values ...v1.EnvVar) *DatasetConfigApplyConfiguration { +func (b *DatasetConfigApplyConfiguration) WithEnv(values ...*v1.EnvVarApplyConfiguration) *DatasetConfigApplyConfiguration { for i := range values { - b.Env = append(b.Env, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) } return b } @@ -55,7 +59,7 @@ func (b *DatasetConfigApplyConfiguration) WithEnv(values ...v1.EnvVar) *DatasetC // WithSecretRef sets the SecretRef 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 SecretRef field is set to the value of the last call. -func (b *DatasetConfigApplyConfiguration) WithSecretRef(value v1.LocalObjectReference) *DatasetConfigApplyConfiguration { +func (b *DatasetConfigApplyConfiguration) WithSecretRef(value corev1.LocalObjectReference) *DatasetConfigApplyConfiguration { b.SecretRef = &value return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/inputmodel.go b/pkg/client/applyconfiguration/trainer/v1alpha1/inputmodel.go index daab737ffd..985d3d4a1f 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/inputmodel.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/inputmodel.go @@ -17,15 +17,16 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // InputModelApplyConfiguration represents a declarative configuration of the InputModel type for use // with apply. type InputModelApplyConfiguration struct { - StorageUri *string `json:"storageUri,omitempty"` - Env []v1.EnvVar `json:"env,omitempty"` - SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` + Env []v1.EnvVarApplyConfiguration `json:"env,omitempty"` + SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` } // InputModelApplyConfiguration constructs a declarative configuration of the InputModel type for use with @@ -45,9 +46,12 @@ func (b *InputModelApplyConfiguration) WithStorageUri(value string) *InputModelA // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. -func (b *InputModelApplyConfiguration) WithEnv(values ...v1.EnvVar) *InputModelApplyConfiguration { +func (b *InputModelApplyConfiguration) WithEnv(values ...*v1.EnvVarApplyConfiguration) *InputModelApplyConfiguration { for i := range values { - b.Env = append(b.Env, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) } return b } @@ -55,7 +59,7 @@ func (b *InputModelApplyConfiguration) WithEnv(values ...v1.EnvVar) *InputModelA // WithSecretRef sets the SecretRef 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 SecretRef field is set to the value of the last call. -func (b *InputModelApplyConfiguration) WithSecretRef(value v1.LocalObjectReference) *InputModelApplyConfiguration { +func (b *InputModelApplyConfiguration) WithSecretRef(value corev1.LocalObjectReference) *InputModelApplyConfiguration { b.SecretRef = &value return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/jobsettemplatespec.go b/pkg/client/applyconfiguration/trainer/v1alpha1/jobsettemplatespec.go index c605b5e3f2..7a94dfe7d2 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/jobsettemplatespec.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/jobsettemplatespec.go @@ -20,14 +20,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - v1alpha2 "sigs.k8s.io/jobset/api/jobset/v1alpha2" + v1alpha2 "sigs.k8s.io/jobset/client-go/applyconfiguration/jobset/v1alpha2" ) // JobSetTemplateSpecApplyConfiguration represents a declarative configuration of the JobSetTemplateSpec type for use // with apply. type JobSetTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *v1alpha2.JobSetSpec `json:"spec,omitempty"` + Spec *v1alpha2.JobSetSpecApplyConfiguration `json:"spec,omitempty"` } // JobSetTemplateSpecApplyConfiguration constructs a declarative configuration of the JobSetTemplateSpec type for use with @@ -181,8 +181,8 @@ func (b *JobSetTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfiguratio // WithSpec sets the Spec 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 Spec field is set to the value of the last call. -func (b *JobSetTemplateSpecApplyConfiguration) WithSpec(value v1alpha2.JobSetSpec) *JobSetTemplateSpecApplyConfiguration { - b.Spec = &value +func (b *JobSetTemplateSpecApplyConfiguration) WithSpec(value *v1alpha2.JobSetSpecApplyConfiguration) *JobSetTemplateSpecApplyConfiguration { + b.Spec = value return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/outputmodel.go b/pkg/client/applyconfiguration/trainer/v1alpha1/outputmodel.go index 8832a43712..798e1dce06 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/outputmodel.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/outputmodel.go @@ -17,15 +17,16 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // OutputModelApplyConfiguration represents a declarative configuration of the OutputModel type for use // with apply. type OutputModelApplyConfiguration struct { - StorageUri *string `json:"storageUri,omitempty"` - Env []v1.EnvVar `json:"env,omitempty"` - SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` + Env []v1.EnvVarApplyConfiguration `json:"env,omitempty"` + SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"` } // OutputModelApplyConfiguration constructs a declarative configuration of the OutputModel type for use with @@ -45,9 +46,12 @@ func (b *OutputModelApplyConfiguration) WithStorageUri(value string) *OutputMode // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. -func (b *OutputModelApplyConfiguration) WithEnv(values ...v1.EnvVar) *OutputModelApplyConfiguration { +func (b *OutputModelApplyConfiguration) WithEnv(values ...*v1.EnvVarApplyConfiguration) *OutputModelApplyConfiguration { for i := range values { - b.Env = append(b.Env, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) } return b } @@ -55,7 +59,7 @@ func (b *OutputModelApplyConfiguration) WithEnv(values ...v1.EnvVar) *OutputMode // WithSecretRef sets the SecretRef 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 SecretRef field is set to the value of the last call. -func (b *OutputModelApplyConfiguration) WithSecretRef(value v1.LocalObjectReference) *OutputModelApplyConfiguration { +func (b *OutputModelApplyConfiguration) WithSecretRef(value corev1.LocalObjectReference) *OutputModelApplyConfiguration { b.SecretRef = &value return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/podspecoverride.go b/pkg/client/applyconfiguration/trainer/v1alpha1/podspecoverride.go index 31e71c2894..444a4dc036 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/podspecoverride.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/podspecoverride.go @@ -17,7 +17,7 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // PodSpecOverrideApplyConfiguration represents a declarative configuration of the PodSpecOverride type for use @@ -26,10 +26,10 @@ type PodSpecOverrideApplyConfiguration struct { TargetJobs []PodSpecOverrideTargetJobApplyConfiguration `json:"targetJobs,omitempty"` Containers []ContainerOverrideApplyConfiguration `json:"containers,omitempty"` InitContainers []ContainerOverrideApplyConfiguration `json:"initContainers,omitempty"` - Volumes []v1.Volume `json:"volumes,omitempty"` + Volumes []v1.VolumeApplyConfiguration `json:"volumes,omitempty"` ServiceAccountName *string `json:"serviceAccountName,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Tolerations []v1.Toleration `json:"tolerations,omitempty"` + Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } // PodSpecOverrideApplyConfiguration constructs a declarative configuration of the PodSpecOverride type for use with @@ -80,9 +80,12 @@ func (b *PodSpecOverrideApplyConfiguration) WithInitContainers(values ...*Contai // WithVolumes adds the given value to the Volumes field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Volumes field. -func (b *PodSpecOverrideApplyConfiguration) WithVolumes(values ...v1.Volume) *PodSpecOverrideApplyConfiguration { +func (b *PodSpecOverrideApplyConfiguration) WithVolumes(values ...*v1.VolumeApplyConfiguration) *PodSpecOverrideApplyConfiguration { for i := range values { - b.Volumes = append(b.Volumes, values[i]) + if values[i] == nil { + panic("nil value passed to WithVolumes") + } + b.Volumes = append(b.Volumes, *values[i]) } return b } @@ -112,9 +115,12 @@ func (b *PodSpecOverrideApplyConfiguration) WithNodeSelector(entries map[string] // WithTolerations adds the given value to the Tolerations field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Tolerations field. -func (b *PodSpecOverrideApplyConfiguration) WithTolerations(values ...v1.Toleration) *PodSpecOverrideApplyConfiguration { +func (b *PodSpecOverrideApplyConfiguration) WithTolerations(values ...*v1.TolerationApplyConfiguration) *PodSpecOverrideApplyConfiguration { for i := range values { - b.Tolerations = append(b.Tolerations, values[i]) + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) } return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/torchelasticpolicy.go b/pkg/client/applyconfiguration/trainer/v1alpha1/torchelasticpolicy.go index 7a56e89cf7..000f2c1edb 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/torchelasticpolicy.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/torchelasticpolicy.go @@ -17,16 +17,16 @@ package v1alpha1 import ( - v2 "k8s.io/api/autoscaling/v2" + v2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" ) // TorchElasticPolicyApplyConfiguration represents a declarative configuration of the TorchElasticPolicy type for use // with apply. type TorchElasticPolicyApplyConfiguration struct { - MaxRestarts *int32 `json:"maxRestarts,omitempty"` - MinNodes *int32 `json:"minNodes,omitempty"` - MaxNodes *int32 `json:"maxNodes,omitempty"` - Metrics []v2.MetricSpec `json:"metrics,omitempty"` + MaxRestarts *int32 `json:"maxRestarts,omitempty"` + MinNodes *int32 `json:"minNodes,omitempty"` + MaxNodes *int32 `json:"maxNodes,omitempty"` + Metrics []v2.MetricSpecApplyConfiguration `json:"metrics,omitempty"` } // TorchElasticPolicyApplyConfiguration constructs a declarative configuration of the TorchElasticPolicy type for use with @@ -62,9 +62,12 @@ func (b *TorchElasticPolicyApplyConfiguration) WithMaxNodes(value int32) *TorchE // WithMetrics adds the given value to the Metrics field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Metrics field. -func (b *TorchElasticPolicyApplyConfiguration) WithMetrics(values ...v2.MetricSpec) *TorchElasticPolicyApplyConfiguration { +func (b *TorchElasticPolicyApplyConfiguration) WithMetrics(values ...*v2.MetricSpecApplyConfiguration) *TorchElasticPolicyApplyConfiguration { for i := range values { - b.Metrics = append(b.Metrics, values[i]) + if values[i] == nil { + panic("nil value passed to WithMetrics") + } + b.Metrics = append(b.Metrics, *values[i]) } return b } diff --git a/pkg/client/applyconfiguration/trainer/v1alpha1/trainer.go b/pkg/client/applyconfiguration/trainer/v1alpha1/trainer.go index 628757be34..d9991106ab 100644 --- a/pkg/client/applyconfiguration/trainer/v1alpha1/trainer.go +++ b/pkg/client/applyconfiguration/trainer/v1alpha1/trainer.go @@ -17,19 +17,19 @@ package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/core/v1" ) // TrainerApplyConfiguration represents a declarative configuration of the Trainer type for use // with apply. type TrainerApplyConfiguration struct { - Image *string `json:"image,omitempty"` - Command []string `json:"command,omitempty"` - Args []string `json:"args,omitempty"` - Env []v1.EnvVar `json:"env,omitempty"` - NumNodes *int32 `json:"numNodes,omitempty"` - ResourcesPerNode *v1.ResourceRequirements `json:"resourcesPerNode,omitempty"` - NumProcPerNode *string `json:"numProcPerNode,omitempty"` + Image *string `json:"image,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + Env []v1.EnvVarApplyConfiguration `json:"env,omitempty"` + NumNodes *int32 `json:"numNodes,omitempty"` + ResourcesPerNode *v1.ResourceRequirementsApplyConfiguration `json:"resourcesPerNode,omitempty"` + NumProcPerNode *string `json:"numProcPerNode,omitempty"` } // TrainerApplyConfiguration constructs a declarative configuration of the Trainer type for use with @@ -69,9 +69,12 @@ func (b *TrainerApplyConfiguration) WithArgs(values ...string) *TrainerApplyConf // WithEnv adds the given value to the Env field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Env field. -func (b *TrainerApplyConfiguration) WithEnv(values ...v1.EnvVar) *TrainerApplyConfiguration { +func (b *TrainerApplyConfiguration) WithEnv(values ...*v1.EnvVarApplyConfiguration) *TrainerApplyConfiguration { for i := range values { - b.Env = append(b.Env, values[i]) + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) } return b } @@ -87,8 +90,8 @@ func (b *TrainerApplyConfiguration) WithNumNodes(value int32) *TrainerApplyConfi // WithResourcesPerNode sets the ResourcesPerNode 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 ResourcesPerNode field is set to the value of the last call. -func (b *TrainerApplyConfiguration) WithResourcesPerNode(value v1.ResourceRequirements) *TrainerApplyConfiguration { - b.ResourcesPerNode = &value +func (b *TrainerApplyConfiguration) WithResourcesPerNode(value *v1.ResourceRequirementsApplyConfiguration) *TrainerApplyConfiguration { + b.ResourcesPerNode = value return b }