cluster: better upgrade logging

This commit is contained in:
Xiang Li 2016-10-11 15:33:11 -07:00
Родитель 854bd225f1
Коммит c02db0562d
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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
}