addressed PR comment for preventing multiple reconciles
@@ -32,6 +32,8 @@ func (s *AzureSqlActionManager) Ensure(ctx context.Context, obj runtime.Object,
if strings.ToLower(instance.Spec.ActionName) == "rolladmincreds" {
+ if !instance.Status.Provisioned {
+
// Determine the secret key based on the spec
if len(instance.Spec.ServerAdminSecretName) == 0 {
key = types.NamespacedName{Name: instance.Spec.ServerName, Namespace: instance.Namespace}
@@ -62,6 +64,7 @@ func (s *AzureSqlActionManager) Ensure(ctx context.Context, obj runtime.Object,
instance.Status.Provisioned = true
instance.Status.Provisioning = false
instance.Status.Message = resourcemanager.SuccessMsg
+ }
} else {
instance.Status.Message = "Unrecognized action"
