Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xingran committed Mar 28, 2023
1 parent 3af4a8c commit 4f686b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions controllers/apps/lifecycle_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,12 +1209,13 @@ func deletePostgresPatroniConfigMap(reqCtx intctrlutil.RequestCtx, cli client.Cl

for _, patroniConfigMapName := range patroniConfigMapNameList {
patroniConfigMap := &corev1.ConfigMap{}
if err := cli.Get(reqCtx.Ctx, types.NamespacedName{Namespace: cluster.Namespace, Name: patroniConfigMapName}, patroniConfigMap); err != nil {
return err
}
if patroniConfigMap.Name == "" {
err := cli.Get(reqCtx.Ctx, types.NamespacedName{Namespace: cluster.Namespace, Name: patroniConfigMapName}, patroniConfigMap)
if apierrors.IsNotFound(err) {
continue
}
if err != nil {
return err
}
if err := cli.Delete(reqCtx.Ctx, patroniConfigMap); err != nil && !apierrors.IsNotFound(err) {
return err
}
Expand Down

0 comments on commit 4f686b1

Please sign in to comment.