Skip to content

Commit

Permalink
removed extra error check and owned service
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamna committed Dec 11, 2023
1 parent 5b7a61b commit 9dd1af9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (r *BasicAuthenticatorReconciler) Reconcile(ctx context.Context, req ctrl.R
func (r *BasicAuthenticatorReconciler) initVars(request ctrl.Request) {
r.basicAuthenticatorNamespace = request.Namespace
//configmap name and credential name's value would be set in reconcile loop

}

// SetupWithManager sets up the controller with the Manager.
Expand All @@ -75,6 +74,7 @@ func (r *BasicAuthenticatorReconciler) SetupWithManager(mgr ctrl.Manager) error
Owns(&appv1.Deployment{}).
Owns(&corev1.ConfigMap{}).
Owns(&corev1.Secret{}).
Owns(&corev1.Service{}).
Watches(
&source.Kind{Type: &appv1.Deployment{}},
handler.EnqueueRequestsFromMapFunc(r.findExternallyManagedDeployments),
Expand Down
6 changes: 2 additions & 4 deletions internal/controller/basic_authenticator/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,8 @@ func (r *BasicAuthenticatorReconciler) createDeploymentAuthenticator(ctx context
r.logger.Info("created deployment")
r.deploymentLabel = newDeployment.Spec.Selector
} else if err != nil {
if err != nil {
r.logger.Error(err, "failed to fetch deployment")
return subreconciler.RequeueWithError(err)
}
r.logger.Error(err, "failed to fetch deployment")
return subreconciler.RequeueWithError(err)
} else {
//update deployment
targetReplica := newDeployment.Spec.Replicas
Expand Down

0 comments on commit 9dd1af9

Please sign in to comment.