Backport of state: canonicalize namespace on restore into release/1.6.x (#18018)
This pull request was automerged via backport-assistant
This commit is contained in:
parent
e891026755
commit
30260f06e8
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
core: Fixed a bug where namespaces were not canonicalized on snapshot restore, resulting in potential nil access panic
|
||||
```
|
|
@ -205,6 +205,8 @@ func (r *StateRestore) ScalingEventsRestore(jobEvents *structs.JobScalingEvents)
|
|||
|
||||
// NamespaceRestore is used to restore a namespace
|
||||
func (r *StateRestore) NamespaceRestore(ns *structs.Namespace) error {
|
||||
// Handle upgrade path.
|
||||
ns.Canonicalize()
|
||||
if err := r.txn.Insert(TableNamespaces, ns); err != nil {
|
||||
return fmt.Errorf("namespace insert failed: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue