diff --git a/helper/args/args_test.go b/helper/args/args_test.go index 82956028ce8..5b8d91b8264 100644 --- a/helper/args/args_test.go +++ b/helper/args/args_test.go @@ -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) } diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 2bdb235b25b..1f269c4c062 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -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) } @@ -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 }