mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Merge pull request #80060 from yastij/improve-error-msg
improve error messages for verifydependency
This commit is contained in:
commit
eb9cec5cad
@ -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)
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user