Skip to content

Commit

Permalink
chore: change task run error wording for clarity (#2959)
Browse files Browse the repository at this point in the history
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
huanjani authored Oct 27, 2021
1 parent 0e115e5 commit 477ef47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/cli/task_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,10 @@ func (o *runTaskOpts) validateFlagsWithWindows() error {
return nil
}
if o.cpu < manifest.MinWindowsTaskCPU {
return fmt.Errorf("CPU %d must be at least %d for a Windows-based task", o.cpu, manifest.MinWindowsTaskCPU)
return fmt.Errorf("CPU is %d, but it must be at least %d for a Windows-based task", o.cpu, manifest.MinWindowsTaskCPU)
}
if o.memory < manifest.MinWindowsTaskMemory {
return fmt.Errorf("memory %d must be at least %d for a Windows-based task", o.memory, manifest.MinWindowsTaskMemory)
return fmt.Errorf("memory is %d, but it must be at least %d for a Windows-based task", o.memory, manifest.MinWindowsTaskMemory)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/cli/task_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestTaskRunOpts_Validate(t *testing.T) {
},
inOS: "WINDOWS_SERVER_2019_CORE",
inArch: "X86_64",
wantedError: errors.New("CPU 260 must be at least 1024 for a Windows-based task"),
wantedError: errors.New("CPU is 260, but it must be at least 1024 for a Windows-based task"),
},
"invalid memory": {
basicOpts: basicOpts{
Expand All @@ -207,7 +207,7 @@ func TestTaskRunOpts_Validate(t *testing.T) {
},
inOS: "WINDOWS_SERVER_2019_CORE",
inArch: "X86_64",
wantedError: errors.New("memory 2000 must be at least 2048 for a Windows-based task"),
wantedError: errors.New("memory is 2000, but it must be at least 2048 for a Windows-based task"),
},
"both dockerfile and image name specified": {
basicOpts: defaultOpts,
Expand Down

0 comments on commit 477ef47

Please sign in to comment.