Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/controller/appwrapper/resource_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (r *AppWrapperReconciler) createComponent(ctx context.Context, aw *workload
if err != nil {
return nil, err, true
}
if r.Config.EnableKueueIntegrations {
if r.Config.EnableKueueIntegrations && !r.Config.DisableChildAdmissionCtrl {
obj.SetLabels(utilmaps.MergeKeepFirst(obj.GetLabels(), map[string]string{AppWrapperLabel: aw.Name, constants.QueueLabel: childJobQueueName}))
} else {
obj.SetLabels(utilmaps.MergeKeepFirst(obj.GetLabels(), map[string]string{AppWrapperLabel: aw.Name}))
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type OperatorConfig struct {
type AppWrapperConfig struct {
ManageJobsWithoutQueueName bool `json:"manageJobsWithoutQueueName,omitempty"`
EnableKueueIntegrations bool `json:"enableKueueIntegrations,omitempty"`
DisableChildAdmissionCtrl bool `json:"disableChildAdmissionCtrl,omitempty"`
FaultTolerance *FaultToleranceConfig `json:"faultTolerance,omitempty"`
}

Expand Down Expand Up @@ -75,6 +76,7 @@ func NewAppWrapperConfig() *AppWrapperConfig {
return &AppWrapperConfig{
ManageJobsWithoutQueueName: true,
EnableKueueIntegrations: true,
DisableChildAdmissionCtrl: false,
FaultTolerance: &FaultToleranceConfig{
WarmupGracePeriod: 5 * time.Minute,
FailureGracePeriod: 1 * time.Minute,
Expand Down
12 changes: 7 additions & 5 deletions pkg/controller/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ func SetupControllers(mgr ctrl.Manager, awConfig *config.AppWrapperConfig) error
return fmt.Errorf("workload controller: %w", err)
}

if err := (&workload.ChildWorkloadReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("child admission controller: %w", err)
if !awConfig.DisableChildAdmissionCtrl {
if err := (&workload.ChildWorkloadReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
return fmt.Errorf("child admission controller: %w", err)
}
}
}

Expand Down