mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
address review comments
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user