@@ -243,7 +243,8 @@ func (c *Cluster) deleteStatefulSet() error {
243
243
c .setProcessName ("deleting statefulset" )
244
244
c .logger .Debugln ("deleting statefulset" )
245
245
if c .Statefulset == nil {
246
- return fmt .Errorf ("there is no statefulset in the cluster" )
246
+ c .logger .Debug ("there is no statefulset in the cluster" )
247
+ return nil
247
248
}
248
249
249
250
err := c .KubeClient .StatefulSets (c .Statefulset .Namespace ).Delete (context .TODO (), c .Statefulset .Name , c .deleteOptions )
@@ -447,7 +448,8 @@ func (c *Cluster) updatePodDisruptionBudget(pdb *policyv1.PodDisruptionBudget) e
447
448
func (c * Cluster ) deletePodDisruptionBudget () error {
448
449
c .logger .Debug ("deleting pod disruption budget" )
449
450
if c .PodDisruptionBudget == nil {
450
- return fmt .Errorf ("there is no pod disruption budget in the cluster" )
451
+ c .logger .Debug ("there is no pod disruption budget in the cluster" )
452
+ return nil
451
453
}
452
454
453
455
pdbName := util .NameFromMeta (c .PodDisruptionBudget .ObjectMeta )
@@ -485,7 +487,8 @@ func (c *Cluster) deleteEndpoint(role PostgresRole) error {
485
487
c .setProcessName ("deleting endpoint" )
486
488
c .logger .Debugln ("deleting endpoint" )
487
489
if c .Endpoints [role ] == nil {
488
- return fmt .Errorf ("there is no %s endpoint in the cluster" , role )
490
+ c .logger .Debugf ("there is no %s endpoint in the cluster" , role )
491
+ return nil
489
492
}
490
493
491
494
if err := c .KubeClient .Endpoints (c .Endpoints [role ].Namespace ).Delete (context .TODO (), c .Endpoints [role ].Name , c .deleteOptions ); err != nil {
0 commit comments