Skip to content

Commit

Permalink
Merge pull request #199 from lichuqiang/image_rollback
Browse files Browse the repository at this point in the history
Add truncate options when opening files to overwrite contents in existing files
  • Loading branch information
droot authored May 22, 2018
2 parents 833dc0f + 80d4d0e commit 4507935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/kubebuilder/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func WriteString(path, value string) {
create(path)
}

f, err := os.OpenFile(path, os.O_WRONLY, 0)
f, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC, 0)
if err != nil {
log.Fatalf("Failed to create %s: %v", path, err)
}
Expand Down

0 comments on commit 4507935

Please sign in to comment.