fix: compose deployment plan preview

This commit is contained in:
Pavel Sviderski committed 2025-04-23 12:04:04 +10:00
1 parent edad2429c5
commit 33550be65e
4 files changed
+55 -35

No files matched your search

+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
}