Skip to content

Commit

Permalink
check for env variable not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunandadadi committed May 29, 2024
1 parent 1f11157 commit 56ffc33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/quay/quayregistry_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ func (r *QuayRegistryReconciler) checkPostgresUpgradeStatus(
log.Error(err, "could not remove owner reference from old postgres pvc")
}

// If user has set POSTGRES_UPGRADE_RETAIN_BACKUP=true, then we should not delete the old PVC
if os.Getenv("POSTGRES_UPGRADE_RETAIN_BACKUP") == "true" {
// If user did not set POSTGRES_UPGRADE_DELETE_BACKUP or POSTGRES_UPGRADE_DELETE_BACKUP=false, then we should not delete the old PVC
delBackup, exists := os.LookupEnv("POSTGRES_UPGRADE_DELETE_BACKUP")
if !exists || (exists && delBackup == "false") {
continue
}

Expand Down

0 comments on commit 56ffc33

Please sign in to comment.