ensure _output exists

This commit is contained in:
Benjamin Elder
2018-09-05 12:03:18 -07:00
parent 33b2fc0e1a
commit 031ce4c0cb

View File

@@ -48,7 +48,15 @@ func buildVersionFile(kubeRoot string) error {
if err != nil {
return err
}
// we will place the file in _output with other build artifacts
outputDir := filepath.Join(kubeRoot, "_output")
// ensure output dir, if we are using bazel it may not exist...
// we can ignore the error because it either exists and we don't care
// or if it fails to create the dir we'll see the file write error below
// we do not use MkdirAll because kubeRoot better already exist..
_ = os.Mkdir(outputDir, os.ModePerm)
// parse it, and populate it into _output/git_version
wroteVersion := false
for _, line := range output {