Commit 80b1ca25 authored by Brian Downs's avatar Brian Downs

move map nil check

parent e9bc6bdc
......@@ -1018,6 +1018,10 @@ func (e *ETCD) StoreSnapshotData(ctx context.Context) error {
return err
}
if snapshotConfigMap.Data == nil {
snapshotConfigMap.Data = make(map[string]string, 0)
}
// remove entries for this node only
for k, v := range snapshotConfigMap.Data {
var sf snapshotFile
......@@ -1029,10 +1033,6 @@ func (e *ETCD) StoreSnapshotData(ctx context.Context) error {
}
}
if snapshotConfigMap.Data == nil {
snapshotConfigMap.Data = make(map[string]string, 0)
}
// this node's entries to the ConfigMap
for k, v := range data {
snapshotConfigMap.Data[k] = v
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment