cluster: better upgrade logging
This commit is contained in:
Родитель
854bd225f1
Коммит
c02db0562d
|
@ -9,16 +9,17 @@ import (
|
|||
)
|
||||
|
||||
func (c *Cluster) upgradeOneMember(m *etcdutil.Member) error {
|
||||
logrus.Infof("upgrading an member: %v", m.Name)
|
||||
pod, err := c.kclient.Pods(c.namespace).Get(m.Name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to get pod (%s): %v", m.Name, err)
|
||||
}
|
||||
logrus.Infof("upgrading the etcd member %v from %s to %s", m.Name, k8sutil.GetEtcdVersion(pod), c.spec.Version)
|
||||
pod.Spec.Containers[0].Image = k8sutil.MakeEtcdImage(c.spec.Version)
|
||||
k8sutil.SetEtcdVersion(pod, c.spec.Version)
|
||||
_, err = c.kclient.Pods(c.namespace).Update(pod)
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to update pod (%s): %v", m.Name, err)
|
||||
return fmt.Errorf("fail to update the etcd member (%s): %v", m.Name, err)
|
||||
}
|
||||
logrus.Infof("finished upgrading the etcd member %v", m.Name)
|
||||
return nil
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче