Skip to content

Commit 102863d

Browse files
committed
Disable MCAD by default
Signed-off-by: Anish Asthana <[email protected]>
1 parent 22d75f6 commit 102863d

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

main.go

Lines changed: 9 additions & 6 deletions
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

Lines changed: 3 additions & 1 deletion
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"`

test/e2e/setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ roleRef:
5656
kind: ClusterRole
5757
name: mcad-controller-rayclusters
5858
EOF
59+
60+
cat <<EOF | kubectl apply -f -
61+
kind: ConfigMap
62+
apiVersion: v1
63+
metadata:
64+
name: codeflare-operator-config
65+
data:
66+
config.yaml: |
67+
mcadEnabled: true
68+
EOF

0 commit comments

Comments
 (0)