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 <[email protected]>
(cherry picked from commit 60f0419)
  • Loading branch information
zdtsw authored and VaishnaviHire committed Nov 29, 2023
1 parent 258fbd7 commit 5e3731b
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 5e3731b

Please sign in to comment.