respond to review

This commit is contained in:
Sergey Dudoladov
2020-03-31 14:27:58 +02:00
parent efbfb2ef7c
commit 63fbab20af
11 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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
View File
@@ -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++ {
+1 -1
View File
@@ -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