kubeadm: Remove leading zeros from etcd member ID in log messages

This commit is contained in:
Daniel Lipovetsky 2023-05-10 16:06:22 -07:00
parent ff4c6916ec
commit ef9f8d7c0c
No known key found for this signature in database
GPG Key ID: 559B3DEDDDF8FF82

View File

@ -349,7 +349,7 @@ func (c *Client) RemoveMember(id uint64) ([]Member, error) {
return true, nil
}
if errors.Is(rpctypes.ErrMemberNotFound, err) {
klog.V(5).Infof("Member was already removed, because member %016x was not found", id)
klog.V(5).Infof("Member was already removed, because member %s was not found", strconv.FormatUint(id, 16))
return true, nil
}
klog.V(5).Infof("Failed to remove etcd member: %v", err)
@ -496,11 +496,11 @@ func (c *Client) MemberPromote(learnerID uint64) error {
return err
}
if !isLearner {
klog.V(1).Infof("[etcd] Member %016x already promoted.", learnerID)
klog.V(1).Infof("[etcd] Member %s already promoted.", strconv.FormatUint(learnerID, 16))
return nil
}
klog.V(1).Infof("[etcd] Promoting a learner as a voting member: %016x", learnerID)
klog.V(1).Infof("[etcd] Promoting a learner as a voting member: %s", strconv.FormatUint(learnerID, 16))
cli, err := c.newEtcdClient(c.Endpoints)
if err != nil {
return err
@ -522,10 +522,10 @@ func (c *Client) MemberPromote(learnerID uint64) error {
_, err = cli.MemberPromote(ctx, learnerID)
if err == nil {
klog.V(1).Infof("[etcd] The learner was promoted as a voting member: %016x", learnerID)
klog.V(1).Infof("[etcd] The learner was promoted as a voting member: %s", strconv.FormatUint(learnerID, 16))
return true, nil
}
klog.V(5).Infof("[etcd] Promoting the learner %016x failed: %v", learnerID, err)
klog.V(5).Infof("[etcd] Promoting the learner %s failed: %v", strconv.FormatUint(learnerID, 16), err)
lastError = err
return false, nil
})