Skip to content

Commit 9721e0e

Browse files
committed
Enable MCAD in e2e tests
1 parent a8e2a93 commit 9721e0e

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

config/e2e/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
kind: ConfigMap
2+
apiVersion: v1
3+
metadata:
4+
name: codeflare-operator-config
5+
data:
6+
config.yaml: |
7+
mcad:
8+
enabled: true

config/e2e/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace: openshift-operators
22

33
bases:
4+
- config.yaml
45
- ../default
56

67
patches:

main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ func main() {
127127
},
128128
LeaderElection: &configv1alpha1.LeaderElectionConfiguration{},
129129
},
130-
MCADEnabled: pointer.Bool(false),
131-
MCAD: &mcadconfig.MCADConfiguration{},
130+
MCAD: &config.MCADConfiguration{
131+
Enabled: pointer.Bool(false),
132+
},
132133
InstaScale: &config.InstaScaleConfiguration{
133134
Enabled: pointer.Bool(false),
134135
InstaScaleConfiguration: instascaleconfig.InstaScaleConfiguration{
@@ -168,8 +169,8 @@ func main() {
168169
})
169170
exitOnError(err, "unable to start manager")
170171

171-
if pointer.BoolDeref(cfg.MCADEnabled, false) {
172-
mcadQueueController := mcad.NewJobController(mgr.GetConfig(), cfg.MCAD, &mcadconfig.MCADConfigurationExtended{})
172+
if pointer.BoolDeref(cfg.MCAD.Enabled, false) {
173+
mcadQueueController := mcad.NewJobController(mgr.GetConfig(), &cfg.MCAD.MCADConfiguration, &mcadconfig.MCADConfigurationExtended{})
173174
if mcadQueueController == nil {
174175
// FIXME: update NewJobController so it follows Go idiomatic error handling and return an error instead of a nil object
175176
os.Exit(1)

pkg/config/config.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ type CodeFlareOperatorConfiguration struct {
3232
ControllerManager `json:",inline"`
3333

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

3937
// The InstaScale controller configuration
4038
InstaScale *InstaScaleConfiguration `json:"instascale,omitempty"`
@@ -46,6 +44,15 @@ type KubeRayConfiguration struct {
4644
RayDashboardOAuthEnabled *bool `json:"rayDashboardOAuthEnabled,omitempty"`
4745
}
4846

47+
type MCADConfiguration struct {
48+
// enabled controls whether the MCAD controller is started.
49+
// It defaults to false.
50+
Enabled *bool `json:"enabled,omitempty"`
51+
52+
// The InstaScale controller configuration
53+
mcad.MCADConfiguration `json:",inline,omitempty"`
54+
}
55+
4956
type InstaScaleConfiguration struct {
5057
// enabled controls whether the InstaScale controller is started.
5158
// It may default to true on platforms that InstaScale supports.

test/e2e/setup.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,3 @@ 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)