Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ef6960d

Browse files
committedApr 4, 2024·
Disable MCAD by default
Signed-off-by: Anish Asthana <[email protected]>
1 parent 22d75f6 commit ef6960d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed
 

‎main.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ func main() {
127127
},
128128
LeaderElection: &configv1alpha1.LeaderElectionConfiguration{},
129129
},
130-
MCAD: &mcadconfig.MCADConfiguration{},
130+
MCADEnabled: pointer.Bool(false),
131+
MCAD: &mcadconfig.MCADConfiguration{},
131132
InstaScale: &config.InstaScaleConfiguration{
132133
Enabled: pointer.Bool(false),
133134
InstaScaleConfiguration: instascaleconfig.InstaScaleConfiguration{
@@ -167,12 +168,14 @@ func main() {
167168
})
168169
exitOnError(err, "unable to start manager")
169170

170-
mcadQueueController := mcad.NewJobController(mgr.GetConfig(), cfg.MCAD, &mcadconfig.MCADConfigurationExtended{})
171-
if mcadQueueController == nil {
172-
// FIXME: update NewJobController so it follows Go idiomatic error handling and return an error instead of a nil object
173-
os.Exit(1)
171+
if pointer.BoolDeref(cfg.MCADEnabled, false) {
172+
mcadQueueController := mcad.NewJobController(mgr.GetConfig(), cfg.MCAD, &mcadconfig.MCADConfigurationExtended{})
173+
if mcadQueueController == nil {
174+
// FIXME: update NewJobController so it follows Go idiomatic error handling and return an error instead of a nil object
175+
os.Exit(1)
176+
}
177+
mcadQueueController.Run(ctx.Done())
174178
}
175-
mcadQueueController.Run(ctx.Done())
176179

177180
if pointer.BoolDeref(cfg.InstaScale.Enabled, false) {
178181
instaScaleController := &instascale.AppWrapperReconciler{

‎pkg/config/config.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ type CodeFlareOperatorConfiguration struct {
3232
ControllerManager `json:",inline"`
3333

3434
// The MCAD controller configuration
35-
MCAD *mcad.MCADConfiguration `json:"mcad,omitempty"`
35+
// MCADEnabled defaults to false
36+
MCADEnabled *bool `json:"mcadEnabled,omitempty"`
37+
MCAD *mcad.MCADConfiguration `json:"mcad,omitempty"`
3638

3739
// The InstaScale controller configuration
3840
InstaScale *InstaScaleConfiguration `json:"instascale,omitempty"`

0 commit comments

Comments
 (0)
Please sign in to comment.