Skip to content

Commit 0e8069a

Browse files
authored
Add Authentication bootstrap for ingress (#1153)
Originating issue: [IBMPrivateCloud/roadmap#68124](https://github.ibm.com/IBMPrivateCloud/roadmap/issues/68124) Previously, if a customer had customized their hostname and certificates using [this process](https://www.ibm.com/docs/en/cloud-paks/foundational-services/4.x_cd?topic=configurations-updating-cp-console-hostname-tls-secret), the customizations would be lost and would require reconfiguring using the settings in the Authentication CR. Now, the bootstrap controller handles finding the existing customizations from previous versions and persists them in a way that is compatible with the new Authentication CR configuration method for ingress. Signed-off-by: Rob Hundley <rwhundle@us.ibm.com>
1 parent 6c28b4b commit 0e8069a

File tree

6 files changed

+391
-49
lines changed

6 files changed

+391
-49
lines changed

cmd/main.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ func main() {
107107
opts.BindFlags(flag.CommandLine)
108108
flag.Parse()
109109

110-
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
110+
ctrlLog := zap.New(zap.UseFlagOptions(&opts))
111+
ctrl.SetLogger(ctrlLog)
111112

112113
watchNamespace, err := controllercommon.GetWatchNamespace()
113114
if err != nil {
@@ -173,9 +174,20 @@ func main() {
173174
os.Exit(1)
174175
}
175176

177+
var dc *discovery.DiscoveryClient
178+
dc, err = discovery.NewDiscoveryClientForConfig(mgr.GetConfig())
179+
if err != nil {
180+
setupLog.Error(err, "failed to get discovery client", "controller", "Authentication")
181+
os.Exit(1)
182+
}
183+
176184
if err = (&bootstrapcontrollers.BootstrapReconciler{
177-
Client: mgr.GetClient(),
178-
}).SetupWithManager(mgr); err != nil {
185+
Client: &controllercommon.FallbackClient{
186+
Client: mgr.GetClient(),
187+
Reader: mgr.GetAPIReader(),
188+
},
189+
DiscoveryClient: dc,
190+
}).SetupWithManager(mgr, ctrlLog); err != nil {
179191
setupLog.Error(err, "unable to create controller", "controller", "Authentication")
180192
os.Exit(1)
181193
}
@@ -201,13 +213,6 @@ func main() {
201213
setupLog.Error(err, "unable to create controller", "controller", "Client")
202214
os.Exit(1)
203215
}
204-
var dc *discovery.DiscoveryClient
205-
dc, err = discovery.NewDiscoveryClientForConfig(mgr.GetConfig())
206-
if err != nil {
207-
setupLog.Error(err, "failed to get discovery client", "controller", "Authentication")
208-
os.Exit(1)
209-
}
210-
211216
if err = (&operatorcontrollers.AuthenticationReconciler{
212217
Client: &controllercommon.FallbackClient{
213218
Client: mgr.GetClient(),

0 commit comments

Comments
 (0)