Skip to content

Commit

Permalink
fix(secret): do not delete secret if cannot find (opendatahub-io#140)
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Nov 27, 2023
1 parent 0403062 commit 60f0419
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/dashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,10 @@ func (d *Dashboard) cleanOauthClient(cli client.Client, dscispec *dsciv1.DSCInit
if !apierrs.IsNotFound(err) {
return fmt.Errorf("error getting secret %s: %w", name, err)
}
}
if err := cli.Delete(context.TODO(), oauthClientSecret); err != nil {
return fmt.Errorf("error deleting secret %s in namespace %s : %w", name, dscispec.ApplicationsNamespace, err)
} else {
if err := cli.Delete(context.TODO(), oauthClientSecret); err != nil {
return fmt.Errorf("error deleting secret %s in namespace %s : %w", name, dscispec.ApplicationsNamespace, err)
}
}
}
return nil
Expand Down

0 comments on commit 60f0419

Please sign in to comment.