Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed Oct 30, 2018
1 parent e9fa36f commit abd2451
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion helper/args/args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ func TestArgs_ContainsEnv(t *testing.T) {
"test",
"test-$",
"test-${asdf",
"test-{asdf}",
"$test",
}
for _, c := range negativeCases {
t.Run(fmt.Sprintf("positive case: %v", c), func(t *testing.T) {
t.Run(fmt.Sprintf("negative case: %v", c), func(t *testing.T) {
if ContainsEnv(c) {
t.Fatalf("ContainsEnv(%v) returned true; want false", c)
}
Expand Down
7 changes: 3 additions & 4 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6154,7 +6154,6 @@ func (ta *TaskArtifact) Validate() error {
mErr.Errors = append(mErr.Errors, fmt.Errorf("destination escapes allocation directory"))
}

// Verify the checksum
if err := ta.validateChecksum(); err != nil {
mErr.Errors = append(mErr.Errors, err)
}
Expand All @@ -6168,9 +6167,9 @@ func (ta *TaskArtifact) validateChecksum() error {
return nil
}

// job struct validation occurs before interpolation resolution can be effective
// skip checking if checksum contain variable reference, and artifacts fetching will
// eventually fail at pick up time if checksum is indeed invalid
// Job struct validation occurs before interpolation resolution can be effective.
// Skip checking if checksum contain variable reference, and artifacts fetching will
// eventually fail, if checksum is indeed invalid.
if args.ContainsEnv(check) {
return nil
}
Expand Down

0 comments on commit abd2451

Please sign in to comment.