Files
GreenHandandGitHub 6acf3d5aef generate clientset with 1.35 code-generator (#4347)
* generate clientset with 1.35 code-generator

Signed-off-by: KunWuLuan <[email protected]>

* Update codegen script to use go list for k8s.io/code-generator path resolution

Signed-off-by: KunWuLuan <[email protected]>

* Run make sync

---------

Signed-off-by: KunWuLuan <[email protected]>
2026-01-13 12:51:42 +08:00

166 lines
8.7 KiB
Go

// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// WorkerGroupSpecApplyConfiguration represents a declarative configuration of the WorkerGroupSpec type for use
// with apply.
//
// WorkerGroupSpec are the specs for the worker pods
type WorkerGroupSpecApplyConfiguration struct {
// Suspend indicates whether a worker group should be suspended.
// A suspended worker group will have all pods deleted.
// This is not a user-facing API and is only used by RayJob DeletionStrategy.
Suspend *bool `json:"suspend,omitempty"`
// we can have multiple worker groups, we distinguish them by name
GroupName *string `json:"groupName,omitempty"`
// Replicas is the number of desired Pods for this worker group. See https://github.com/ray-project/kuberay/pull/1443 for more details about the reason for making this field optional.
Replicas *int32 `json:"replicas,omitempty"`
// MinReplicas denotes the minimum number of desired Pods for this worker group.
MinReplicas *int32 `json:"minReplicas,omitempty"`
// MaxReplicas denotes the maximum number of desired Pods for this worker group, and the default value is maxInt32.
MaxReplicas *int32 `json:"maxReplicas,omitempty"`
// IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type.
// This value is only used with the Ray Autoscaler enabled and defaults to the value set by the AutoscalingConfig if not specified for this worker group.
IdleTimeoutSeconds *int32 `json:"idleTimeoutSeconds,omitempty"`
// Resources specifies the resource quantities for this worker group.
// These values override the resources passed to `rayStartParams` for the group, but
// have no effect on the resources set at the K8s Pod container level.
Resources map[string]string `json:"resources,omitempty"`
// Labels specifies the Ray node labels for this worker group.
// These labels will also be added to the Pods of this worker group and override the `--labels`
// argument passed to `rayStartParams`.
Labels map[string]string `json:"labels,omitempty"`
// RayStartParams are the params of the start command: address, object-store-memory, ...
RayStartParams map[string]string `json:"rayStartParams,omitempty"`
// Template is a pod template for the worker
Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"`
// ScaleStrategy defines which pods to remove
ScaleStrategy *ScaleStrategyApplyConfiguration `json:"scaleStrategy,omitempty"`
// NumOfHosts denotes the number of hosts to create per replica. The default value is 1.
NumOfHosts *int32 `json:"numOfHosts,omitempty"`
}
// WorkerGroupSpecApplyConfiguration constructs a declarative configuration of the WorkerGroupSpec type for use with
// apply.
func WorkerGroupSpec() *WorkerGroupSpecApplyConfiguration {
return &WorkerGroupSpecApplyConfiguration{}
}
// WithSuspend sets the Suspend 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 Suspend field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithSuspend(value bool) *WorkerGroupSpecApplyConfiguration {
b.Suspend = &value
return b
}
// WithGroupName sets the GroupName 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 GroupName field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithGroupName(value string) *WorkerGroupSpecApplyConfiguration {
b.GroupName = &value
return b
}
// WithReplicas sets the Replicas 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 Replicas field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithReplicas(value int32) *WorkerGroupSpecApplyConfiguration {
b.Replicas = &value
return b
}
// WithMinReplicas sets the MinReplicas 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 MinReplicas field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithMinReplicas(value int32) *WorkerGroupSpecApplyConfiguration {
b.MinReplicas = &value
return b
}
// WithMaxReplicas sets the MaxReplicas 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 MaxReplicas field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithMaxReplicas(value int32) *WorkerGroupSpecApplyConfiguration {
b.MaxReplicas = &value
return b
}
// WithIdleTimeoutSeconds sets the IdleTimeoutSeconds 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 IdleTimeoutSeconds field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithIdleTimeoutSeconds(value int32) *WorkerGroupSpecApplyConfiguration {
b.IdleTimeoutSeconds = &value
return b
}
// WithResources puts the entries into the Resources field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Resources field,
// overwriting an existing map entries in Resources field with the same key.
func (b *WorkerGroupSpecApplyConfiguration) WithResources(entries map[string]string) *WorkerGroupSpecApplyConfiguration {
if b.Resources == nil && len(entries) > 0 {
b.Resources = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Resources[k] = v
}
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *WorkerGroupSpecApplyConfiguration) WithLabels(entries map[string]string) *WorkerGroupSpecApplyConfiguration {
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
}
return b
}
// WithRayStartParams puts the entries into the RayStartParams field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the RayStartParams field,
// overwriting an existing map entries in RayStartParams field with the same key.
func (b *WorkerGroupSpecApplyConfiguration) WithRayStartParams(entries map[string]string) *WorkerGroupSpecApplyConfiguration {
if b.RayStartParams == nil && len(entries) > 0 {
b.RayStartParams = make(map[string]string, len(entries))
}
for k, v := range entries {
b.RayStartParams[k] = v
}
return b
}
// WithTemplate sets the Template 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 Template field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithTemplate(value *corev1.PodTemplateSpecApplyConfiguration) *WorkerGroupSpecApplyConfiguration {
b.Template = value
return b
}
// WithScaleStrategy sets the ScaleStrategy 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 ScaleStrategy field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithScaleStrategy(value *ScaleStrategyApplyConfiguration) *WorkerGroupSpecApplyConfiguration {
b.ScaleStrategy = value
return b
}
// WithNumOfHosts sets the NumOfHosts 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 NumOfHosts field is set to the value of the last call.
func (b *WorkerGroupSpecApplyConfiguration) WithNumOfHosts(value int32) *WorkerGroupSpecApplyConfiguration {
b.NumOfHosts = &value
return b
}