mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Check Annotations map against nil for ConfigMapLock#Update()
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
c88b7cdd58
commit
086d6ae9bb
@ -86,6 +86,9 @@ func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if cml.cm.Annotations == nil {
|
||||
cml.cm.Annotations = make(map[string]string)
|
||||
}
|
||||
cml.cm.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
|
||||
cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(cml.cm)
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user