Skip to content

Commit 8741f7b

Browse files
committed
add bryce comments
1 parent fb3b660 commit 8741f7b

File tree

7 files changed

+145
-142
lines changed

7 files changed

+145
-142
lines changed

Diff for: openapi/generated_openapi/zz_generated.openapi.go

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: openapi/openapi.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -33242,7 +33242,7 @@
3324233242
}
3324333243
}
3324433244
},
33245-
"com.github.openshift.api.operator.v1alpha1.GangSchedulingPolicy": {
33245+
"com.github.openshift.api.operator.v1alpha1.GangScheduling": {
3324633246
"description": "Kueue provides the ability to admit workloads all in one (gang admission) and evicts workloads if they are not ready within a specific time.",
3324733247
"type": "object",
3324833248
"properties": {
@@ -33474,22 +33474,22 @@
3347433474
"integrations"
3347533475
],
3347633476
"properties": {
33477-
"gangSchedulingPolicy": {
33478-
"description": "gangSchedulingPolicy controls how Kueue admits workloads. Gang Scheduling is the act of all or nothing scheduling, where workloads do not become ready within a certain period, they may be evicted and later retried. This field is optional.",
33479-
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.GangSchedulingPolicy"
33477+
"gangScheduling": {
33478+
"description": "gangScheduling controls how Kueue admits workloads. Gang Scheduling is the act of all or nothing scheduling, where workloads do not become ready within a certain period, they may be evicted and later retried. This field is optional.",
33479+
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.GangScheduling"
3348033480
},
3348133481
"integrations": {
3348233482
"description": "integrations is a required field that configures the Kueue's workload integrations. Kueue has both standard integrations, known as job frameworks, and external integrations known as external frameworks. Kueue will only manage workloads that correspond to the specified integrations.",
3348333483
"default": {},
3348433484
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.Integrations"
3348533485
},
3348633486
"preemption": {
33487-
"description": "preemption is the process of evicting one or more admitted Workloads to accommodate another Workload. Kueue has classical premption and preemption via fair sharing.",
33487+
"description": "preemption is the process of evicting one or more admitted Workloads to accommodate another Workload. Kueue has classical premption and preemption via fair sharing. This field is optional.",
3348833488
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.Preemption"
3348933489
},
33490-
"queueLabelPolicy": {
33491-
"description": "queueLabelPolicy controls how kueue manages workloads The default behavior of Kueue will manage workloads that have a queue-name label. Workloads that are missing these label will be ignored by Kueue. This field is optional.",
33492-
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.QueueLabelPolicy"
33490+
"workloadManagement": {
33491+
"description": "workloadManagement controls how kueue manages workloads. The default behavior of Kueue will manage workloads that have a queue-name label. Workloads that are missing these label will be ignored by Kueue. This field is optional.",
33492+
"$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.WorkloadManagement"
3349333493
}
3349433494
}
3349533495
},
@@ -33948,15 +33948,6 @@
3394833948
}
3394933949
}
3395033950
},
33951-
"com.github.openshift.api.operator.v1alpha1.QueueLabelPolicy": {
33952-
"type": "object",
33953-
"properties": {
33954-
"policy": {
33955-
"description": "policy controls whether or not Kueue reconciles jobs that don't set the label kueue.x-k8s.io/queue-name. The allowed values are QueueNameRequired and QueueNameOptional. QueueNameOptional means that workloads will be suspended on creation and a label will be added via a mutating webhook. QueueNameRequired means that workloads that are managed by Kueue must have a label kueue.x-k8s.io/queue-name. If this label is not present on the workload, then Kueue will ignore this workload. Defaults to QueueNameRequired.",
33956-
"type": "string"
33957-
}
33958-
}
33959-
},
3396033951
"com.github.openshift.api.operator.v1alpha1.RepositoryDigestMirrors": {
3396133952
"description": "RepositoryDigestMirrors holds cluster-wide information about how to handle mirros in the registries config. Note: the mirrors only work when pulling the images that are referenced by their digests.",
3396233953
"type": "object",
@@ -34078,6 +34069,15 @@
3407834069
}
3407934070
}
3408034071
},
34072+
"com.github.openshift.api.operator.v1alpha1.WorkloadManagement": {
34073+
"type": "object",
34074+
"properties": {
34075+
"labelPolicy": {
34076+
"description": "labelPolicy controls whether or not Kueue reconciles jobs that don't set the label kueue.x-k8s.io/queue-name. The allowed values are QueueName and None. None means that workloads will be suspended on creation and a label will be added via a mutating webhook. QueueName means that workloads that are managed by Kueue must have a label kueue.x-k8s.io/queue-name. If this label is not present on the workload, then Kueue will ignore this workload. Defaults to QueueName.",
34077+
"type": "string"
34078+
}
34079+
}
34080+
},
3408134081
"com.github.openshift.api.operatorcontrolplane.v1alpha1.LogEntry": {
3408234082
"description": "LogEntry records events",
3408334083
"type": "object",

Diff for: operator/v1alpha1/types_kueue.go

+26-25
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,21 @@ type KueueConfiguration struct {
4747
// Kueue will only manage workloads that correspond to the specified integrations.
4848
// +required
4949
Integrations Integrations `json:"integrations"`
50-
// queueLabelPolicy controls how kueue manages workloads
50+
// workloadManagement controls how kueue manages workloads.
5151
// The default behavior of Kueue will manage workloads that have a queue-name label.
5252
// Workloads that are missing these label will be ignored by Kueue.
5353
// This field is optional.
5454
// +optional
55-
QueueLabelPolicy *QueueLabelPolicy `json:"queueLabelPolicy,omitempty"`
56-
// gangSchedulingPolicy controls how Kueue admits workloads.
55+
WorkloadManagement *WorkloadManagement `json:"workloadManagement,omitempty"`
56+
// gangScheduling controls how Kueue admits workloads.
5757
// Gang Scheduling is the act of all or nothing scheduling,
5858
// where workloads do not become ready within a certain period, they may be evicted and later retried.
5959
// This field is optional.
6060
// +optional
61-
GangSchedulingPolicy *GangSchedulingPolicy `json:"gangSchedulingPolicy,omitempty"`
61+
GangScheduling *GangScheduling `json:"gangScheduling,omitempty"`
6262
// preemption is the process of evicting one or more admitted Workloads to accommodate another Workload.
6363
// Kueue has classical premption and preemption via fair sharing.
64+
// This field is optional.
6465
// +optional
6566
Preemption *Preemption `json:"preemption,omitempty"`
6667
}
@@ -191,25 +192,25 @@ type LabelKeys struct {
191192
}
192193

193194
// +kubebuilder:validation:Enum=ByWorkload;Disabled
194-
type GangSchedulingPolicyOptions string
195+
type GangSchedulingPolicy string
195196

196197
const (
197-
GangSchedulingPolicyByWorkload GangSchedulingPolicyOptions = "ByWorkload"
198-
GangSchedulingPolicyDisabled GangSchedulingPolicyOptions = "Disabled"
198+
GangSchedulingPolicyByWorkload GangSchedulingPolicy = "ByWorkload"
199+
GangSchedulingPolicyDisabled GangSchedulingPolicy = "Disabled"
199200
)
200201

201202
// +kubebuilder:validation:Enum=Parallel;Sequential
202-
type GangSchedulingAdmissionOptions string
203+
type GangSchedulingWorkloadAdmission string
203204

204205
const (
205-
GangSchedulingAdmissionOptionsSequential GangSchedulingAdmissionOptions = "Sequential"
206-
GangSchedulingAdmissionOptionsParallel GangSchedulingAdmissionOptions = "Parallel"
206+
GangSchedulingWorkloadAdmissionSequential GangSchedulingWorkloadAdmission = "Sequential"
207+
GangSchedulingWorkloadAdmissionParallel GangSchedulingWorkloadAdmission = "Parallel"
207208
)
208209

209210
// Kueue provides the ability to admit workloads all in one (gang admission)
210211
// and evicts workloads if they are not ready within a specific time.
211-
// +kubebuilder:validation:XValidation:rule="has(self.policy) && self.policy == 'ByWorkload' ? has(self.byWorkload) : !has(self.byWorkload)",message="byWorkload is required when policy is ByWorkload, and forbidden otherwise"
212-
type GangSchedulingPolicy struct {
212+
// +kubebuilder:validation:XValidation:rule="has(self.policy) && self.policy == 'ByWorkload' ? has(self.byWorkload) : !has(self.byWorkload)",message="byWorkload is required when policy is byWorkload, and forbidden otherwise"
213+
type GangScheduling struct {
213214
// policy allows you to enable and configure gang scheduling.
214215
// This is an optional field.
215216
// The allowed values are ByWorkload and Disabled.
@@ -218,7 +219,7 @@ type GangSchedulingPolicy struct {
218219
// for admission as a single unit.
219220
// Where workloads do not become ready over time, the entire workload may then be evicted and retried at a later time.
220221
// +optional
221-
Policy *GangSchedulingPolicyOptions `json:"policy,omitempty"`
222+
Policy *GangSchedulingPolicy `json:"policy,omitempty"`
222223
// byWorkload controls how admission is done.
223224
// byWorkload is only required if policy is equal to ByWorkload.
224225
// +optional
@@ -236,30 +237,30 @@ type ByWorkload struct {
236237
// This may lead to a deadlock where workloads are in contention for cluster capacity and
237238
// pods from another workload having successfully scheduled prevent pods from the current workload scheduling.
238239
// +optional
239-
Admission *GangSchedulingAdmissionOptions `json:"admission,omitempty"`
240+
Admission *GangSchedulingWorkloadAdmission `json:"admission,omitempty"`
240241
}
241242

242-
// +kubebuilder:validation:Enum=QueueNameRequired;QueueNameOptional
243-
type QueueLabelNamePolicy string
243+
// +kubebuilder:validation:Enum=QueueName;None
244+
type LabelPolicy string
244245

245246
const (
246-
QueueLabelNamePolicyRequired QueueLabelNamePolicy = "QueueNameRequired"
247-
QueueLabelNamePolicyOptional QueueLabelNamePolicy = "QueueNameOptional"
247+
QueueLabelNamePolicyRequired LabelPolicy = "QueueName"
248+
QueueLabelNamePolicyOptional LabelPolicy = "None"
248249
)
249250

250-
type QueueLabelPolicy struct {
251-
// policy controls whether or not Kueue reconciles
251+
type WorkloadManagement struct {
252+
// labelPolicy controls whether or not Kueue reconciles
252253
// jobs that don't set the label kueue.x-k8s.io/queue-name.
253-
// The allowed values are QueueNameRequired and QueueNameOptional.
254-
// QueueNameOptional means that workloads will be suspended on
254+
// The allowed values are QueueName and None.
255+
// None means that workloads will be suspended on
255256
// creation and a label will be added via a mutating webhook.
256-
// QueueNameRequired means that workloads that are managed
257+
// QueueName means that workloads that are managed
257258
// by Kueue must have a label kueue.x-k8s.io/queue-name.
258259
// If this label is not present on the workload, then Kueue will
259260
// ignore this workload.
260-
// Defaults to QueueNameRequired.
261+
// Defaults to QueueName.
261262
// +optional
262-
Policy *QueueLabelNamePolicy `json:"policy,omitempty"`
263+
LabelPolicy *LabelPolicy `json:"labelPolicy,omitempty"`
263264
}
264265

265266
// +kubebuilder:validation:Enum=Classical;FairSharing

0 commit comments

Comments
 (0)