Skip to content

Commit 6fc1223

Browse files
Cleanup: rename operator to schedulingDomain (#448)
Part of #442
1 parent e91a240 commit 6fc1223

103 files changed

Lines changed: 854 additions & 893 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/v1alpha1/common_types.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright SAP SE
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package v1alpha1
5+
6+
// SchedulingDomain reflects the logical domain for scheduling.
7+
type SchedulingDomain string
8+
9+
const (
10+
// SchedulingDomainNova indicates scheduling related to the
11+
// openstack Nova service, which is the compute service responsible for
12+
// managing virtual machines in an openstack cloud infrastructure.
13+
SchedulingDomainNova SchedulingDomain = "nova"
14+
// SchedulingDomainCinder indicates scheduling related to the
15+
// openstack Cinder service, which is the block storage service responsible
16+
// for managing volumes in an openstack cloud infrastructure.
17+
SchedulingDomainCinder SchedulingDomain = "cinder"
18+
// SchedulingDomainManila indicates scheduling related to the openstack
19+
// Manila service, which is the shared file system service responsible
20+
// for managing shared file systems in an openstack cloud infrastructure.
21+
SchedulingDomainManila SchedulingDomain = "manila"
22+
// SchedulingDomainMachines indicates scheduling related to the ironcore
23+
// machines, which are virtual machines managed by the ironcore platform.
24+
SchedulingDomainMachines SchedulingDomain = "machines"
25+
// SchedulingDomainPods indicates scheduling related to Kubernetes pods,
26+
// which are the smallest deployable units in a Kubernetes cluster.
27+
SchedulingDomainPods SchedulingDomain = "pods"
28+
)

api/v1alpha1/datasource_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ const (
193193
)
194194

195195
type DatasourceSpec struct {
196-
// The operator by which this datasource should be synced.
197-
Operator string `json:"operator,omitempty"`
196+
// SchedulingDomain defines in which scheduling domain this datasource
197+
// is used (e.g., nova, cinder, manila).
198+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
198199

199200
// If given, configures a Prometheus datasource to fetch.
200201
// Type must be set to "prometheus" if this is used.

api/v1alpha1/decision_types.go

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,10 @@ import (
99
runtime "k8s.io/apimachinery/pkg/runtime"
1010
)
1111

12-
// The type of decision.
13-
type DecisionType string
14-
15-
const (
16-
// The decision was created by the nova external scheduler call.
17-
// Usually we refer to this as nova initial placement, it also includes
18-
// migrations or resizes.
19-
DecisionTypeNovaServer DecisionType = "nova-server"
20-
// The decision was created by the cinder external scheduler call.
21-
DecisionTypeCinderVolume DecisionType = "cinder-volume"
22-
// The decision was created by the manila external scheduler call.
23-
DecisionTypeManilaShare DecisionType = "manila-share"
24-
// The decision was created by spawning an ironcore machine.
25-
DecisionTypeIroncoreMachine DecisionType = "ironcore-machine"
26-
// The decision was created for a pod.
27-
DecisionTypePod DecisionType = "pod"
28-
)
29-
3012
type DecisionSpec struct {
31-
// The operator by which this decision should be extracted.
32-
Operator string `json:"operator,omitempty"`
13+
// SchedulingDomain defines in which scheduling domain this decision
14+
// was or is processed (e.g., nova, cinder, manila).
15+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
3316

3417
// A reference to the pipeline that should be used for this decision.
3518
// This reference can be used to look up the pipeline definition and its
@@ -41,8 +24,6 @@ type DecisionSpec struct {
4124
// This can be used to correlate multiple decisions for the same resource.
4225
ResourceID string `json:"resourceID"`
4326

44-
// The type of decision, indicating what has initiated this decision.
45-
Type DecisionType `json:"type"`
4627
// If the type is "nova", this field contains the raw nova decision request.
4728
// +kubebuilder:validation:Optional
4829
NovaRaw *runtime.RawExtension `json:"novaRaw,omitempty"`

api/v1alpha1/knowledge_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ type KnowledgeExtractorSpec struct {
3535
}
3636

3737
type KnowledgeSpec struct {
38-
// The operator by which this knowledge should be extracted.
39-
Operator string `json:"operator,omitempty"`
38+
// SchedulingDomain defines in which scheduling domain this knowledge
39+
// is used (e.g., nova, cinder, manila).
40+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
4041

4142
// The feature extractor to use for extracting this knowledge.
4243
Extractor KnowledgeExtractorSpec `json:"extractor,omitempty"`

api/v1alpha1/kpi_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ type KPIDependenciesSpec struct {
2424
}
2525

2626
type KPISpec struct {
27-
// The operator by which this kpi should be executed.
28-
Operator string `json:"operator,omitempty"`
27+
// SchedulingDomain defines in which scheduling domain this kpi
28+
// is used (e.g., nova, cinder, manila).
29+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
2930

3031
// The name of the kpi in the cortex implementation.
3132
Impl string `json:"impl"`

api/v1alpha1/pipeline_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ const (
2828
)
2929

3030
type PipelineSpec struct {
31-
// The operator by which this pipeline should be handled.
32-
Operator string `json:"operator,omitempty"`
31+
// SchedulingDomain defines in which scheduling domain this pipeline
32+
// is used (e.g., nova, cinder, manila).
33+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
3334
// An optional description of the pipeline.
3435
// +kubebuilder:validation:Optional
3536
Description string `json:"description,omitempty"`

api/v1alpha1/step_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ type WeigherSpec struct {
3939
}
4040

4141
type StepSpec struct {
42-
// The operator by which this step should be executed.
43-
Operator string `json:"operator,omitempty"`
42+
// SchedulingDomain defines in which scheduling domain this step
43+
// is used (e.g., nova, cinder, manila).
44+
SchedulingDomain SchedulingDomain `json:"schedulingDomain"`
4445

4546
// The type of the scheduler step.
4647
Type StepType `json:"type"`

cmd/main.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ func main() {
301301
}
302302
// Inferred through the base controller.
303303
decisionController.Client = multiclusterClient
304-
decisionController.OperatorName = config.Operator
305304
if err := (decisionController).SetupWithManager(mgr, multiclusterClient); err != nil {
306305
setupLog.Error(err, "unable to create controller", "controller", "DecisionReconciler")
307306
os.Exit(1)
@@ -319,7 +318,6 @@ func main() {
319318
}
320319
// Inferred through the base controller.
321320
deschedulingsController.Client = multiclusterClient
322-
deschedulingsController.OperatorName = config.Operator
323321
if err := (deschedulingsController).SetupWithManager(mgr, multiclusterClient); err != nil {
324322
setupLog.Error(err, "unable to create controller", "controller", "DeschedulingsReconciler")
325323
os.Exit(1)
@@ -341,7 +339,6 @@ func main() {
341339
}
342340
// Inferred through the base controller.
343341
controller.Client = multiclusterClient
344-
controller.OperatorName = config.Operator
345342
if err := (controller).SetupWithManager(mgr, multiclusterClient); err != nil {
346343
setupLog.Error(err, "unable to create controller", "controller", "DecisionReconciler")
347344
os.Exit(1)
@@ -355,7 +352,6 @@ func main() {
355352
}
356353
// Inferred through the base controller.
357354
controller.Client = multiclusterClient
358-
controller.OperatorName = config.Operator
359355
if err := (controller).SetupWithManager(mgr, multiclusterClient); err != nil {
360356
setupLog.Error(err, "unable to create controller", "controller", "DecisionReconciler")
361357
os.Exit(1)
@@ -369,7 +365,6 @@ func main() {
369365
}
370366
// Inferred through the base controller.
371367
controller.Client = multiclusterClient
372-
controller.OperatorName = config.Operator
373368
if err := (controller).SetupWithManager(mgr, multiclusterClient); err != nil {
374369
setupLog.Error(err, "unable to create controller", "controller", "DecisionReconciler")
375370
os.Exit(1)
@@ -382,7 +377,6 @@ func main() {
382377
}
383378
// Inferred through the base controller.
384379
controller.Client = multiclusterClient
385-
controller.OperatorName = config.Operator
386380
if err := (controller).SetupWithManager(mgr, multiclusterClient); err != nil {
387381
setupLog.Error(err, "unable to create controller", "controller", "DecisionReconciler")
388382
os.Exit(1)
@@ -392,8 +386,10 @@ func main() {
392386
// Setup a controller which will reconcile the history and explanation for
393387
// decision resources.
394388
explanationController := &explanation.Controller{
395-
Client: multiclusterClient,
396-
OperatorName: config.Operator,
389+
Client: multiclusterClient,
390+
// The explanation controller is compatible with multiple scheduling
391+
// domains.
392+
SchedulingDomain: config.SchedulingDomain,
397393
}
398394
if err := explanationController.SetupWithManager(mgr, multiclusterClient); err != nil {
399395
setupLog.Error(err, "unable to create controller", "controller", "ExplanationController")
@@ -458,8 +454,10 @@ func main() {
458454
}
459455
if slices.Contains(config.EnabledControllers, "kpis-controller") {
460456
if err := (&kpis.Controller{
461-
Client: multiclusterClient,
462-
OperatorName: config.Operator,
457+
Client: multiclusterClient,
458+
// The kpis controller is compatible with multiple scheduling
459+
// domains.
460+
SchedulingDomain: config.SchedulingDomain,
463461
}).SetupWithManager(mgr, multiclusterClient); err != nil {
464462
setupLog.Error(err, "unable to create controller", "controller", "KPIController")
465463
os.Exit(1)

config/crd/bases/cortex.cloud_datasources.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,6 @@ spec:
191191
- syncInterval
192192
- type
193193
type: object
194-
operator:
195-
description: The operator by which this datasource should be synced.
196-
type: string
197194
prometheus:
198195
description: |-
199196
If given, configures a Prometheus datasource to fetch.
@@ -250,6 +247,11 @@ spec:
250247
- timeRange
251248
- type
252249
type: object
250+
schedulingDomain:
251+
description: |-
252+
SchedulingDomain defines in which scheduling domain this datasource
253+
is used (e.g., nova, cinder, manila).
254+
type: string
253255
ssoSecretRef:
254256
description: |-
255257
Kubernetes secret ref for an optional sso certificate to access the host.
@@ -270,6 +272,7 @@ spec:
270272
type: string
271273
required:
272274
- databaseSecretRef
275+
- schedulingDomain
273276
- type
274277
type: object
275278
status:

config/crd/bases/cortex.cloud_decisions.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ spec:
123123
decision request.
124124
type: object
125125
x-kubernetes-preserve-unknown-fields: true
126-
operator:
127-
description: The operator by which this decision should be extracted.
128-
type: string
129126
pipelineRef:
130127
description: |-
131128
A reference to the pipeline that should be used for this decision.
@@ -221,14 +218,15 @@ spec:
221218
For example, this can be the UUID of a nova instance or cinder volume.
222219
This can be used to correlate multiple decisions for the same resource.
223220
type: string
224-
type:
225-
description: The type of decision, indicating what has initiated this
226-
decision.
221+
schedulingDomain:
222+
description: |-
223+
SchedulingDomain defines in which scheduling domain this decision
224+
was or is processed (e.g., nova, cinder, manila).
227225
type: string
228226
required:
229227
- pipelineRef
230228
- resourceID
231-
- type
229+
- schedulingDomain
232230
type: object
233231
status:
234232
description: status defines the observed state of Decision

0 commit comments

Comments
 (0)