fix: compose deployment plan preview

This commit is contained in:
Pavel Sviderski
2025-04-23 12:04:04 +10:00
parent edad2429c5
commit 33550be65e
4 changed files with 55 additions and 35 deletions
+10
View File
@@ -57,3 +57,13 @@ func InspectClusterState(ctx context.Context, cli Client) (*ClusterState, error)
Machines: machines,
}, nil
}
// Machine returns the machine with the given name or ID from the cluster state.
func (s *ClusterState) Machine(nameOrID string) (*Machine, bool) {
for _, m := range s.Machines {
if m.Info.Id == nameOrID || m.Info.Name == nameOrID {
return m, true
}
}
return nil, false
}