/
rayclusterspec.go
88 lines (78 loc) · 4.73 KB
/
rayclusterspec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// RayClusterSpecApplyConfiguration represents an declarative configuration of the RayClusterSpec type for use
// with apply.
type RayClusterSpecApplyConfiguration struct {
HeadGroupSpec *HeadGroupSpecApplyConfiguration `json:"headGroupSpec,omitempty"`
WorkerGroupSpecs []WorkerGroupSpecApplyConfiguration `json:"workerGroupSpecs,omitempty"`
RayVersion *string `json:"rayVersion,omitempty"`
EnableInTreeAutoscaling *bool `json:"enableInTreeAutoscaling,omitempty"`
AutoscalerOptions *AutoscalerOptionsApplyConfiguration `json:"autoscalerOptions,omitempty"`
HeadServiceAnnotations map[string]string `json:"headServiceAnnotations,omitempty"`
Suspend *bool `json:"suspend,omitempty"`
}
// RayClusterSpecApplyConfiguration constructs an declarative configuration of the RayClusterSpec type for use with
// apply.
func RayClusterSpec() *RayClusterSpecApplyConfiguration {
return &RayClusterSpecApplyConfiguration{}
}
// WithHeadGroupSpec sets the HeadGroupSpec 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 HeadGroupSpec field is set to the value of the last call.
func (b *RayClusterSpecApplyConfiguration) WithHeadGroupSpec(value *HeadGroupSpecApplyConfiguration) *RayClusterSpecApplyConfiguration {
b.HeadGroupSpec = value
return b
}
// WithWorkerGroupSpecs adds the given value to the WorkerGroupSpecs 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 WorkerGroupSpecs field.
func (b *RayClusterSpecApplyConfiguration) WithWorkerGroupSpecs(values ...*WorkerGroupSpecApplyConfiguration) *RayClusterSpecApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithWorkerGroupSpecs")
}
b.WorkerGroupSpecs = append(b.WorkerGroupSpecs, *values[i])
}
return b
}
// WithRayVersion sets the RayVersion 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 RayVersion field is set to the value of the last call.
func (b *RayClusterSpecApplyConfiguration) WithRayVersion(value string) *RayClusterSpecApplyConfiguration {
b.RayVersion = &value
return b
}
// WithEnableInTreeAutoscaling sets the EnableInTreeAutoscaling 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 EnableInTreeAutoscaling field is set to the value of the last call.
func (b *RayClusterSpecApplyConfiguration) WithEnableInTreeAutoscaling(value bool) *RayClusterSpecApplyConfiguration {
b.EnableInTreeAutoscaling = &value
return b
}
// WithAutoscalerOptions sets the AutoscalerOptions 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 AutoscalerOptions field is set to the value of the last call.
func (b *RayClusterSpecApplyConfiguration) WithAutoscalerOptions(value *AutoscalerOptionsApplyConfiguration) *RayClusterSpecApplyConfiguration {
b.AutoscalerOptions = value
return b
}
// WithHeadServiceAnnotations puts the entries into the HeadServiceAnnotations 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 HeadServiceAnnotations field,
// overwriting an existing map entries in HeadServiceAnnotations field with the same key.
func (b *RayClusterSpecApplyConfiguration) WithHeadServiceAnnotations(entries map[string]string) *RayClusterSpecApplyConfiguration {
if b.HeadServiceAnnotations == nil && len(entries) > 0 {
b.HeadServiceAnnotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.HeadServiceAnnotations[k] = v
}
return b
}
// 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 *RayClusterSpecApplyConfiguration) WithSuspend(value bool) *RayClusterSpecApplyConfiguration {
b.Suspend = &value
return b
}