Skip to content

Commit 9a4e261

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Get the current list of PVCs to delete before deleting them
There is a failure case where if a PVC fails to delete, that this line refuses to get executed. The root of the issue is that PVCs can be deleted at different times during the "rmdata" job, we need to refresh the list of PVCs to be deleted before doing the final pass through them. Issue: [ch6499]
1 parent e2efc34 commit 9a4e261

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pgo-rmdata/rmdata/process.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ func Delete(request Request) {
6666
return
6767
}
6868

69-
pvcList, err := getPVCs(request)
70-
if err != nil {
71-
log.Error(err)
72-
}
7369
if request.IsBackup {
7470
log.Info("rmdata.Process backup use case")
7571
//the case of removing a backup using
@@ -106,9 +102,7 @@ func Delete(request Request) {
106102

107103
//handle the case of 'pgo delete cluster mycluster'
108104
removeCluster(request)
109-
err = kubeapi.Deletepgcluster(request.RESTClient,
110-
request.ClusterName, request.Namespace)
111-
if err != nil {
105+
if err := kubeapi.Deletepgcluster(request.RESTClient, request.ClusterName, request.Namespace); err != nil {
112106
log.Error(err)
113107
}
114108
removeServices(request)
@@ -117,6 +111,10 @@ func Delete(request Request) {
117111
removePgtasks(request)
118112
//removeClusterJobs(request)
119113
if request.RemoveData {
114+
pvcList, err := getPVCs(request)
115+
if err != nil {
116+
log.Error(err)
117+
}
120118
removePVCs(pvcList, request)
121119
}
122120

0 commit comments

Comments
 (0)