Skip to content

Commit b48034d

Browse files
authored
Fix major version upgrade return code (zalando#2056)
Fix major version upgrade return code
1 parent e0c4603 commit b48034d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/cluster/majorversionupgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ func (c *Cluster) majorVersionUpgrade() error {
117117
var result string
118118
if resultIdCheck != "0" {
119119
c.logger.Infof("User id was identified as: %s, hence default user is non-root already", resultIdCheck)
120-
result, err = c.ExecCommand(podName, "/bin/bash", "-c", upgradeCommand)
120+
result, err = c.ExecCommand(podName, "/bin/bash", "-o", "pipefail", "-c", upgradeCommand)
121121
} else {
122122
c.logger.Infof("User id was identified as: %s, using su to reach the postgres user", resultIdCheck)
123-
result, err = c.ExecCommand(podName, "/bin/su", "postgres", "-c", upgradeCommand)
123+
result, err = c.ExecCommand(podName, "/bin/su", "postgres", "-o", "pipefail", "-c", upgradeCommand)
124124
}
125125
if err != nil {
126126
c.eventRecorder.Eventf(c.GetReference(), v1.EventTypeWarning, "Major Version Upgrade", "Upgrade from %d to %d FAILED: %v", c.currentMajorVersion, desiredVersion, err)

0 commit comments

Comments
 (0)