make sure upgrade script runs on the master (#1715)
* make sure upgrade script runs on the master * show a bit more logs from upgrade script
This commit is contained in:
parent
f7858ffb70
commit
1ed16fadca
|
|
@ -83,7 +83,7 @@ func (c *Cluster) majorVersionUpgrade() error {
|
|||
|
||||
var masterPod *v1.Pod
|
||||
|
||||
for _, pod := range pods {
|
||||
for i, pod := range pods {
|
||||
ps, _ := c.patroni.GetMemberData(&pod)
|
||||
|
||||
if ps.State != "running" {
|
||||
|
|
@ -92,7 +92,7 @@ func (c *Cluster) majorVersionUpgrade() error {
|
|||
}
|
||||
|
||||
if ps.Role == "master" {
|
||||
masterPod = &pod
|
||||
masterPod = &pods[i]
|
||||
c.currentMajorVersion = ps.ServerVersion
|
||||
}
|
||||
}
|
||||
|
|
@ -112,7 +112,7 @@ func (c *Cluster) majorVersionUpgrade() error {
|
|||
return err
|
||||
}
|
||||
|
||||
c.logger.Infof("upgrade action triggered and command completed: %s", result[:50])
|
||||
c.logger.Infof("upgrade action triggered and command completed: %s", result[:100])
|
||||
c.eventRecorder.Eventf(c.GetReference(), v1.EventTypeNormal, "Major Version Upgrade", "Upgrade from %d to %d finished", c.currentMajorVersion, desiredVersion)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue