mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Fix nil map in full snapshot configmap reconcile
If a full reconcile wins the race against sync of an individual snapshot resource, or someone intentionally deletes the configmap, the data map could be nil and cause a crash. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
db7091b3f6
commit
319dca3e82
@ -252,6 +252,10 @@ func (e *etcdSnapshotHandler) reconcile() error {
|
||||
}
|
||||
}
|
||||
|
||||
if len(snapshots) > 0 && snapshotConfigMap.Data == nil {
|
||||
snapshotConfigMap.Data = map[string]string{}
|
||||
}
|
||||
|
||||
// Ensure keys for existing snapshots
|
||||
for sfKey, esf := range snapshots {
|
||||
sf := snapshotFile{}
|
||||
|
Loading…
Reference in New Issue
Block a user