Skip to content

Commit 666ac73

Browse files
authored
Remove dependency on authentication_controller while reconciling monitor_controller (tigera#3854)
1 parent f33a8ee commit 666ac73

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pkg/controller/monitor/monitor_controller.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
"github.com/tigera/operator/pkg/dns"
4848
"github.com/tigera/operator/pkg/render"
4949
rcertificatemanagement "github.com/tigera/operator/pkg/render/certificatemanagement"
50+
rauth "github.com/tigera/operator/pkg/render/common/authentication"
5051
"github.com/tigera/operator/pkg/render/common/networkpolicy"
5152
rsecret "github.com/tigera/operator/pkg/render/common/secret"
5253
"github.com/tigera/operator/pkg/render/kubecontrollers"
@@ -326,15 +327,13 @@ func (r *ReconcileMonitor) Reconcile(ctx context.Context, request reconcile.Requ
326327
r.status.SetDegraded(operatorv1.ResourceReadError, "Error querying Authentication", err, reqLogger)
327328
return reconcile.Result{}, err
328329
}
329-
if authenticationCR != nil && authenticationCR.Status.State != operatorv1.TigeraStatusReady {
330-
r.status.SetDegraded(operatorv1.ResourceNotReady, fmt.Sprintf("Authentication is not ready - authenticationCR status: %s", authenticationCR.Status.State), err, reqLogger)
331-
return reconcile.Result{}, nil
332-
}
333-
334-
keyValidatorConfig, err := utils.GetKeyValidatorConfig(ctx, r.client, authenticationCR, r.clusterDomain)
335-
if err != nil {
336-
r.status.SetDegraded(operatorv1.ResourceUpdateError, "Failed to process the authentication CR.", err, reqLogger)
337-
return reconcile.Result{}, err
330+
var keyValidatorConfig rauth.KeyValidatorConfig
331+
if authenticationCR != nil && authenticationCR.Status.State == operatorv1.TigeraStatusReady {
332+
keyValidatorConfig, err = utils.GetKeyValidatorConfig(ctx, r.client, authenticationCR, r.clusterDomain)
333+
if err != nil {
334+
r.status.SetDegraded(operatorv1.ResourceUpdateError, "Failed to process the authentication CR.", err, reqLogger)
335+
return reconcile.Result{}, err
336+
}
338337
}
339338

340339
// Validate that the tier watch is ready before querying the tier to ensure we utilize the cache.

0 commit comments

Comments
 (0)