Navigation Menu

Skip to content

Commit

Permalink
improve error messages for verifydependency
Browse files Browse the repository at this point in the history
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
  • Loading branch information
yastij committed Jul 11, 2019
1 parent 2659b37 commit 32a139e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/verifydependencies/verifydependencies.go
Expand Up @@ -60,8 +60,11 @@ func main() {
panic(err)
}

mismatchErrorMessage := "ERROR: %v indicates that %v should be at version %v, but the following files didn't match:\n\n" +
"%v\n\nif you are changing the version of %v, make sure all of the following files are updated with the newest version including %v\n" +
"then run ./hack/verify-external-dependencies-version.sh\n\n"
externalDeps := &dependencies{}

var pathsToUpdate []string
err = yaml.Unmarshal(externalDepsFile, externalDeps)
if err != nil {
panic(err)
Expand All @@ -84,9 +87,12 @@ func main() {
}
}
if !found {
log.Fatalf("%v dependency: file %v doesn't contain the expected version %v or matcher %v did change. check the %v file", dep.Name, refPath.Path, dep.Version, refPath.Match, externalDepsFilePath)
pathsToUpdate = append(pathsToUpdate, refPath.Path)
}
}
if len(pathsToUpdate) > 0 {
log.Fatalf(mismatchErrorMessage, externalDepsFilePath, dep.Name, dep.Version, strings.Join(pathsToUpdate, "\n"), dep.Name, externalDepsFilePath)
}
}

}

0 comments on commit 32a139e

Please sign in to comment.