mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 10:21:45 +02:00
respond to review
This commit is contained in:
@@ -679,7 +679,7 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
|
||||
}
|
||||
}()
|
||||
|
||||
if c.OpConfig.ShouldDeleteUnusedPVC && oldSpec.Spec.NumberOfInstances > newSpec.Spec.NumberOfInstances {
|
||||
if c.OpConfig.EnableUnusedPVCDeletion && oldSpec.Spec.NumberOfInstances > newSpec.Spec.NumberOfInstances {
|
||||
c.logger.Debug("deleting pvc of shut down pods")
|
||||
|
||||
for i := oldSpec.Spec.NumberOfInstances - 1; i >= newSpec.Spec.NumberOfInstances; i-- {
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
|
||||
|
||||
// remove unused PVCs in case deleting them during scale down failed; see Update()
|
||||
// the last pvc stays until the cluster is explicitly deleted as opposed to being scaled down to 0 pods
|
||||
if c.OpConfig.ShouldDeleteUnusedPVC && c.getNumberOfInstances(&c.Spec) > 0 {
|
||||
if c.OpConfig.EnableUnusedPVCDeletion && c.getNumberOfInstances(&c.Spec) > 0 {
|
||||
|
||||
// XXX that also deletes PVC of pods shut down before this change is deployed
|
||||
for i := c.getNumberOfInstances(&c.Spec); ; i++ {
|
||||
|
||||
@@ -153,7 +153,7 @@ type Config struct {
|
||||
ProtectedRoles []string `name:"protected_role_names" default:"admin"`
|
||||
PostgresSuperuserTeams []string `name:"postgres_superuser_teams" default:""`
|
||||
SetMemoryRequestToLimit bool `name:"set_memory_request_to_limit" default:"false"`
|
||||
ShouldDeleteUnusedPVC bool `name:"should_delete_unused_pvc" default:"false"`
|
||||
EnableUnusedPVCDeletion bool `name:"enable_unused_pvc_deletion" default:"false"`
|
||||
}
|
||||
|
||||
// MustMarshal marshals the config or panics
|
||||
|
||||
Reference in New Issue
Block a user