Fix upgrade command, pods got lost.
This commit is contained in:
parent
1f1eab4b28
commit
2efa831245
|
|
@ -1,6 +1,8 @@
|
||||||
package cluster
|
package cluster
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/zalando/postgres-operator/pkg/spec"
|
"github.com/zalando/postgres-operator/pkg/spec"
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
)
|
)
|
||||||
|
|
@ -78,8 +80,8 @@ func (c *Cluster) majorVersionUpgrade() error {
|
||||||
if c.currentMajorVersion < desiredVersion {
|
if c.currentMajorVersion < desiredVersion {
|
||||||
podName := &spec.NamespacedName{Namespace: masterPod.Namespace, Name: masterPod.Name}
|
podName := &spec.NamespacedName{Namespace: masterPod.Namespace, Name: masterPod.Name}
|
||||||
c.logger.Infof("triggering major version upgrade on pod %s of %d pods", masterPod.Name, numberOfPods)
|
c.logger.Infof("triggering major version upgrade on pod %s of %d pods", masterPod.Name, numberOfPods)
|
||||||
//result, err := c.ExecCommand(podName, "/bin/su", "postgres", "-c", "whoami")
|
upgradeCommand := fmt.Sprintf("/usr/bin/python3 /scripts/inplace_upgrade.py %d 2>&1 | tee last_upgrade.log", numberOfPods)
|
||||||
_, err := c.ExecCommand(podName, "/bin/su", "postgres", "-c", "/usr/bin/python3 /scripts/inplace_upgrade.py %d 2>&1 | tee last_upgrade.log")
|
_, err := c.ExecCommand(podName, "/bin/su", "postgres", "-c", upgradeCommand)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue