Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 62a76fb

Browse files
committed
Validate service operation prior to running
Looks like this was dropped in the last refactoring. Next step is to separate out the command layer from the operation layer and to properly test both. For now I'm releasing a hotfix. - Fix display of CPU units and MiB in confirmation message
1 parent 4300a71 commit 62a76fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/service_update.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (o *ServiceUpdateOperation) Validate() {
3636
err := validateCpuAndMemory(o.Cpu, o.Memory)
3737

3838
if err != nil {
39-
console.ErrorExit(err, "Invalid settings: %d CPU units / %d MiB", o.Cpu, o.Memory)
39+
console.ErrorExit(err, "Invalid settings: %s CPU units / %s MiB", o.Cpu, o.Memory)
4040
}
4141
}
4242

@@ -72,6 +72,8 @@ At least one of --cpu or --memory must be specified.`,
7272
Memory: flagServiceUpdateMemory,
7373
}
7474

75+
operation.Validate()
76+
7577
updateService(operation)
7678
},
7779
}
@@ -93,5 +95,5 @@ func updateService(operation *ServiceUpdateOperation) {
9395
)
9496

9597
ecs.UpdateServiceTaskDefinition(operation.ServiceName, newTaskDefinitionArn)
96-
console.Info("Updated service %s to %d CPU units / %d MiB", operation.ServiceName, operation.Cpu, operation.Memory)
98+
console.Info("Updated service %s to %s CPU units / %s MiB", operation.ServiceName, operation.Cpu, operation.Memory)
9799
}

0 commit comments

Comments
 (0)