Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Nov 17, 2023
1 parent 2f75557 commit 7f7c1db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions internal/controllers/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ func (r *Reconciler) reconcile(ctx context.Context, cr *model.CryostatInstance)
return reconcile.Result{}, err
}

// Finalizer for CA Cert secrets
err = r.finalizeTLS(ctx, cr)
if err != nil {
return reconcile.Result{}, err
}

err = common.RemoveFinalizer(ctx, r.Client, cr.Object, cryostatFinalizer)
if err != nil {
return reconcile.Result{}, err
Expand Down Expand Up @@ -199,8 +205,8 @@ func (r *Reconciler) reconcile(ctx context.Context, cr *model.CryostatInstance)
// Set up TLS using cert-manager, if available
var tlsConfig *resources.TLSConfig

// Finalizer for CA Cert secrets
err = r.finalizeTLS(ctx, cr)
// Reconcile RBAC resources for Cryostat
err = r.reconcileRBAC(ctx, cr)
if err != nil {
return reconcile.Result{}, err
}
Expand Down Expand Up @@ -237,12 +243,6 @@ func (r *Reconciler) reconcile(ctx context.Context, cr *model.CryostatInstance)
}
}

// Reconcile RBAC resources for Cryostat
err = r.reconcileRBAC(ctx, cr)
if err != nil {
return reconcile.Result{}, err
}

serviceSpecs := &resources.ServiceSpecs{
InsightsURL: r.InsightsProxy,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/controllers/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ func (c *controllerTest) commonTests() {
})

It("should fail to reconcile", func() {
t.expectAlreadyOwnedError(reconcileErr, "Secret", t.NewCACertSecret(nsInput.Namespace), otherInput)
t.expectAlreadyOwnedError(reconcileErr, "RoleBinding", t.NewRoleBinding(nsInput.Namespace), otherInput)
})

It("should emit a CryostatNameConflict event", func() {
Expand Down

0 comments on commit 7f7c1db

Please sign in to comment.