Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move secret deletion to best effort again #1281

Merged
merged 2 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/v1alpha2/mysqlserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func NewDefaultMySQLServer(name, resourceGroup, location string) *MySQLServer {
Name: "GP_Gen5_4",
Tier: SkuTier("GeneralPurpose"),
Family: "Gen5",
Size: "51200",
Size: "107374182400",
Capacity: 4,
},
ServerVersion: ServerVersion("8.0"),
Expand All @@ -78,7 +78,7 @@ func NewDefaultMySQLServer(name, resourceGroup, location string) *MySQLServer {
StorageProfile: &MySQLStorageProfile{
BackupRetentionDays: to.Int32Ptr(10),
GeoRedundantBackup: "Disabled",
StorageMB: to.Int32Ptr(5120),
StorageMB: to.Int32Ptr(100 * 1024),
StorageAutogrow: "Disabled",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@ func (s *AzureSqlManagedUserManager) Delete(ctx context.Context, obj runtime.Obj
azerr := errhelp.NewAzureError(err)
if helpers.ContainsString(catch, azerr.Type) {
// Best case deletion of secrets
err2 := s.DeleteSecrets(ctx, instance, s.SecretClient)
if err2 != nil {
instance.Status.Message = "failed to delete secrets for managed identity user, err: " + err2.Error()
return false, err2
}
s.DeleteSecrets(ctx, instance, s.SecretClient)

return false, nil
}
Expand Down Expand Up @@ -204,11 +200,7 @@ func (s *AzureSqlManagedUserManager) Delete(ctx context.Context, obj runtime.Obj
}

// Best case deletion of secrets
err = s.DeleteSecrets(ctx, instance, s.SecretClient)
if err != nil {
instance.Status.Message = "failed to delete secrets for managed identity user, err: " + err.Error()
return false, err
}
s.DeleteSecrets(ctx, instance, s.SecretClient)

instance.Status.Message = fmt.Sprintf("Delete AzureSqlManagedUser succeeded")

Expand Down