Skip to content

Commit d213ee1

Browse files
authored
remove ChildAdmissionController needed by Kueue 0.6 (#186)
1 parent 870d410 commit d213ee1

File tree

6 files changed

+9
-146
lines changed

6 files changed

+9
-146
lines changed

config/default/config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
data:
66
config.yaml: |
77
appwrapper:
8-
disableChildAdmissionCtrl: true
98
enableKueueIntegrations: true
109
controllerManager:
1110
health:

config/dev/config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ metadata:
55
data:
66
config.yaml: |
77
appwrapper:
8-
appwrapper:
9-
disableChildAdmissionCtrl: true
108
enableKueueIntegrations: true
119
controllerManager:
1210
health:

internal/controller/appwrapper/resource_management.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
3333
"sigs.k8s.io/controller-runtime/pkg/log"
34-
"sigs.k8s.io/kueue/pkg/controller/constants"
3534
"sigs.k8s.io/kueue/pkg/podset"
3635
utilmaps "sigs.k8s.io/kueue/pkg/util/maps"
3736
)
@@ -82,13 +81,9 @@ func (r *AppWrapperReconciler) createComponent(ctx context.Context, aw *workload
8281
if err != nil {
8382
return err, true
8483
}
85-
if r.Config.EnableKueueIntegrations && !r.Config.DisableChildAdmissionCtrl {
86-
obj.SetLabels(utilmaps.MergeKeepFirst(obj.GetLabels(), map[string]string{AppWrapperLabel: aw.Name, constants.QueueLabel: childJobQueueName}))
87-
} else {
88-
obj.SetLabels(utilmaps.MergeKeepFirst(obj.GetLabels(), map[string]string{AppWrapperLabel: aw.Name}))
89-
}
90-
9184
awLabels := map[string]string{AppWrapperLabel: aw.Name}
85+
obj.SetLabels(utilmaps.MergeKeepFirst(obj.GetLabels(), awLabels))
86+
9287
for podSetsIdx, podSet := range componentStatus.PodSets {
9388
toInject := &workloadv1beta2.AppWrapperPodSetInfo{}
9489
if r.Config.EnableKueueIntegrations {

internal/controller/workload/child_admission_controller.go

Lines changed: 0 additions & 118 deletions
This file was deleted.

pkg/config/config.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ type OperatorConfig struct {
3131
}
3232

3333
type AppWrapperConfig struct {
34-
EnableKueueIntegrations bool `json:"enableKueueIntegrations,omitempty"`
35-
DisableChildAdmissionCtrl bool `json:"disableChildAdmissionCtrl,omitempty"`
36-
KueueJobReconciller *KueueJobReconciller `json:"kueueJobReconciller,omitempty"`
37-
UserRBACAdmissionCheck bool `json:"userRBACAdmissionCheck,omitempty"`
38-
FaultTolerance *FaultToleranceConfig `json:"faultTolerance,omitempty"`
39-
SchedulerName string `json:"schedulerName,omitempty"`
40-
DefaultQueueName string `json:"defaultQueueName,omitempty"`
34+
EnableKueueIntegrations bool `json:"enableKueueIntegrations,omitempty"`
35+
KueueJobReconciller *KueueJobReconciller `json:"kueueJobReconciller,omitempty"`
36+
UserRBACAdmissionCheck bool `json:"userRBACAdmissionCheck,omitempty"`
37+
FaultTolerance *FaultToleranceConfig `json:"faultTolerance,omitempty"`
38+
SchedulerName string `json:"schedulerName,omitempty"`
39+
DefaultQueueName string `json:"defaultQueueName,omitempty"`
4140
}
4241

4342
type KueueJobReconciller struct {
@@ -87,8 +86,7 @@ type HealthConfiguration struct {
8786
// NewAppWrapperConfig constructs an AppWrapperConfig and fills in default values
8887
func NewAppWrapperConfig() *AppWrapperConfig {
8988
return &AppWrapperConfig{
90-
EnableKueueIntegrations: true,
91-
DisableChildAdmissionCtrl: true,
89+
EnableKueueIntegrations: true,
9290
KueueJobReconciller: &KueueJobReconciller{
9391
ManageJobsWithoutQueueName: true,
9492
WaitForPodsReady: &v1beta1.WaitForPodsReady{Enable: true},

pkg/controller/setup.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@ func SetupControllers(mgr ctrl.Manager, awConfig *config.AppWrapperConfig) error
4848
).SetupWithManager(mgr); err != nil {
4949
return fmt.Errorf("workload controller: %w", err)
5050
}
51-
52-
if !awConfig.DisableChildAdmissionCtrl {
53-
if err := (&workload.ChildWorkloadReconciler{
54-
Client: mgr.GetClient(),
55-
Scheme: mgr.GetScheme(),
56-
}).SetupWithManager(mgr); err != nil {
57-
return fmt.Errorf("child admission controller: %w", err)
58-
}
59-
}
6051
}
6152

6253
if err := (&appwrapper.AppWrapperReconciler{

0 commit comments

Comments
 (0)