address review comments

This commit is contained in:
Mahmood Ali
2018-10-30 13:58:52 -04:00
parent e9fa36f9ef
commit abd2451d52
2 changed files with 6 additions and 5 deletions

View File

@@ -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)
}

View File

@@ -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
}