Skip to content

Disable MCAD by default #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
15 changes: 9 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func main() {
},
LeaderElection: &configv1alpha1.LeaderElectionConfiguration{},
},
MCAD: &mcadconfig.MCADConfiguration{},
MCADEnabled: pointer.Bool(false),
MCAD: &mcadconfig.MCADConfiguration{},
InstaScale: &config.InstaScaleConfiguration{
Enabled: pointer.Bool(false),
InstaScaleConfiguration: instascaleconfig.InstaScaleConfiguration{
Expand Down Expand Up @@ -167,12 +168,14 @@ func main() {
})
exitOnError(err, "unable to start manager")

mcadQueueController := mcad.NewJobController(mgr.GetConfig(), cfg.MCAD, &mcadconfig.MCADConfigurationExtended{})
if mcadQueueController == nil {
// FIXME: update NewJobController so it follows Go idiomatic error handling and return an error instead of a nil object
os.Exit(1)
if pointer.BoolDeref(cfg.MCADEnabled, false) {
mcadQueueController := mcad.NewJobController(mgr.GetConfig(), cfg.MCAD, &mcadconfig.MCADConfigurationExtended{})
if mcadQueueController == nil {
// FIXME: update NewJobController so it follows Go idiomatic error handling and return an error instead of a nil object
os.Exit(1)
}
mcadQueueController.Run(ctx.Done())
}
mcadQueueController.Run(ctx.Done())

if pointer.BoolDeref(cfg.InstaScale.Enabled, false) {
instaScaleController := &instascale.AppWrapperReconciler{
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ type CodeFlareOperatorConfiguration struct {
ControllerManager `json:",inline"`

// The MCAD controller configuration
MCAD *mcad.MCADConfiguration `json:"mcad,omitempty"`
// MCADEnabled defaults to false
MCADEnabled *bool `json:"mcadEnabled,omitempty"`
MCAD *mcad.MCADConfiguration `json:"mcad,omitempty"`

// The InstaScale controller configuration
InstaScale *InstaScaleConfiguration `json:"instascale,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ roleRef:
kind: ClusterRole
name: mcad-controller-rayclusters
EOF

cat <<EOF | kubectl apply -f -
kind: ConfigMap
apiVersion: v1
metadata:
name: codeflare-operator-config
data:
config.yaml: |
mcadEnabled: true
EOF