move InitCluster to Machine

This commit is contained in:
Pavel Sviderski
2024-09-06 13:03:45 +10:00
parent 31e2b8456f
commit 7e93abb972
5 changed files with 131 additions and 120 deletions
+6
View File
@@ -32,6 +32,12 @@ func (s *State) Load() error {
if err = proto.Unmarshal(data, s.State); err != nil {
return fmt.Errorf("parse state file %q: %w", s.path, err)
}
if s.State.Machines == nil {
s.State.Machines = make(map[string]*pb.Machine)
}
if s.State.Endpoints == nil {
s.State.Endpoints = make(map[string]*pb.MachineEndpoints)
}
return nil
}