Skip to content

Commit 92e6eb5

Browse files
inline appwrapper config struct at the json level
1 parent 980311d commit 92e6eb5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-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

@@ -247,7 +247,7 @@ func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, m
247247
if isAPIAvailable(ctx, mgr, workloadAPI) {
248248
setupLog.Info("Workload API available, enabling AppWrappers")
249249
go setupAppWrapperController(mgr, cfg, certsReady)
250-
return awctrl.SetupIndexers(ctx, mgr, &cfg.AppWrapper.Config)
250+
return awctrl.SetupIndexers(ctx, mgr, cfg.AppWrapper.Config)
251251
} else {
252252
// If AppWrappers are enabled and the Workload API becomes available later, initiate an orderly
253253
// restart of the codeflare operator to enable the workload indexer to be setup in the the new instance of the operator.
@@ -265,14 +265,14 @@ func setupAppWrapperWebhooks(mgr ctrl.Manager, cfg *config.CodeFlareOperatorConf
265265
setupLog.Info("Waiting for certificate generation to complete")
266266
<-certsReady
267267
setupLog.Info("Setting up AppWrapper webhooks")
268-
exitOnError(awctrl.SetupWebhooks(mgr, &cfg.AppWrapper.Config), "unable to setup AppWrapper webhooks")
268+
exitOnError(awctrl.SetupWebhooks(mgr, cfg.AppWrapper.Config), "unable to setup AppWrapper webhooks")
269269
}
270270

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

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

pkg/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type AppWrapperConfiguration struct {
4141

4242
// AppWrapper contains the AppWrapper controller configuration
4343
// +optional
44-
Config awconfig.AppWrapperConfig `json:"config,omitempty"`
44+
Config *awconfig.AppWrapperConfig `json:",inline"`
4545
}
4646

4747
type KubeRayConfiguration struct {

0 commit comments

Comments
 (0)