mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-21 10:45:25 +02:00
Worker: prefer assigned CPU/memory to CPU/memory (#250)
* Worker: prefer assigned CPU/memory to CPU/memory * orchard get worker: show default CPU, default memory and labels
This commit is contained in:
@@ -69,16 +69,19 @@ func runGetWorker(cmd *cobra.Command, args []string) error {
|
||||
|
||||
table.AddRow("Machine ID", worker.MachineID)
|
||||
table.AddRow("Scheduling paused", worker.SchedulingPaused)
|
||||
table.AddRow("Default CPU", worker.DefaultCPU)
|
||||
table.AddRow("Default memory", worker.DefaultCPU)
|
||||
|
||||
var resourcesInfo string
|
||||
if len(worker.Resources) != 0 {
|
||||
resourceDescriptions := lo.MapToSlice(worker.Resources, func(key string, value uint64) string {
|
||||
return fmt.Sprintf("%s: %d", key, value)
|
||||
})
|
||||
resourcesInfo = strings.Join(resourceDescriptions, "\n")
|
||||
}
|
||||
resourcesInfo := strings.Join(lo.MapToSlice(worker.Resources, func(key string, value uint64) string {
|
||||
return fmt.Sprintf("%s: %d", key, value)
|
||||
}), "\n")
|
||||
table.AddRow("Resources", nonEmptyOrNone(resourcesInfo))
|
||||
|
||||
labelsInfo := strings.Join(lo.MapToSlice(worker.Labels, func(key string, value string) string {
|
||||
return fmt.Sprintf("%s: %s", key, value)
|
||||
}), "\n")
|
||||
table.AddRow("Labels", nonEmptyOrNone(labelsInfo))
|
||||
|
||||
fmt.Println(table)
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user