update spec when updating status (#2546)

* update spec when updating status
* only setSpec of pg resource is not empty
This commit is contained in:
Felix Kunde
2024-02-20 10:24:24 +01:00
committed by GitHub
parent 2af9cfa257
commit e34f19be01
3 changed files with 32 additions and 8 deletions
+1 -2
View File
@@ -209,7 +209,6 @@ func (client *KubernetesClient) SetPostgresCRDStatus(clusterName spec.Namespaced
return pg, fmt.Errorf("could not update status: %v", err)
}
// update the spec, maintaining the new resourceVersion.
return pg, nil
}
@@ -220,7 +219,7 @@ func (client *KubernetesClient) SetFinalizer(clusterName spec.NamespacedName, pg
patch []byte
err error
)
pg.ObjectMeta.SetFinalizers(finalizers)
pg.ObjectMeta.Finalizers = finalizers
if len(finalizers) > 0 {
patch, err = json.Marshal(struct {