Skip to content

Commit af91e9c

Browse files
committed
inline AppWrapperConfig struct
1 parent 676528e commit af91e9c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func main() {
146146
},
147147
AppWrapper: &config.AppWrapperConfiguration{
148148
Enabled: ptr.To(false),
149-
Config: awconfig.NewAppWrapperConfig(),
149+
Config: *awconfig.NewAppWrapperConfig(),
150150
},
151151
}
152152

@@ -252,7 +252,7 @@ func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, m
252252
if isAPIAvailable(ctx, mgr, workloadAPI) {
253253
setupLog.Info("Workload API available, enabling AppWrappers")
254254
go setupAppWrapperController(mgr, cfg, certsReady)
255-
return awctrl.SetupIndexers(ctx, mgr, cfg.AppWrapper.Config)
255+
return awctrl.SetupIndexers(ctx, mgr, &cfg.AppWrapper.Config)
256256
} else {
257257
// If AppWrappers are enabled and the Workload API becomes available later, initiate an orderly
258258
// restart of the codeflare operator to enable the workload indexer to be setup in the the new instance of the operator.
@@ -270,14 +270,14 @@ func setupAppWrapperWebhooks(mgr ctrl.Manager, cfg *config.CodeFlareOperatorConf
270270
setupLog.Info("Waiting for certificate generation to complete")
271271
<-certsReady
272272
setupLog.Info("Setting up AppWrapper webhooks")
273-
exitOnError(awctrl.SetupWebhooks(mgr, cfg.AppWrapper.Config), "unable to setup AppWrapper webhooks")
273+
exitOnError(awctrl.SetupWebhooks(mgr, &cfg.AppWrapper.Config), "unable to setup AppWrapper webhooks")
274274
}
275275

276276
func setupAppWrapperController(mgr ctrl.Manager, cfg *config.CodeFlareOperatorConfiguration, certsReady chan struct{}) {
277277
setupLog.Info("Waiting for certificate generation to complete")
278278
<-certsReady
279279
setupLog.Info("Setting up AppWrapper controller")
280-
exitOnError(awctrl.SetupControllers(mgr, cfg.AppWrapper.Config), "unable to setup AppWrapper controller")
280+
exitOnError(awctrl.SetupControllers(mgr, &cfg.AppWrapper.Config), "unable to setup AppWrapper controller")
281281
}
282282

283283
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;update

pkg/config/config.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ type CodeFlareOperatorConfiguration struct {
3838
type AppWrapperConfiguration struct {
3939
// Enabled controls whether or not the AppWrapper Controller is enabled
4040
Enabled *bool `json:"enabled,omitempty"`
41+
4142
// AppWrapper contains the AppWrapper controller configuration
42-
Config *awconfig.AppWrapperConfig `json:"config,omitempty"`
43+
// +optional
44+
Config awconfig.AppWrapperConfig `json:"config,omitempty"`
4345
}
4446

4547
type KubeRayConfiguration struct {

0 commit comments

Comments
 (0)