Skip to content

Commit

Permalink
Fix: create whole config path if it doesnt exist yet (knative#2490)
Browse files Browse the repository at this point in the history
* fix

Signed-off-by: David Fridrich <[email protected]>

* fix

Signed-off-by: David Fridrich <[email protected]>

---------

Signed-off-by: David Fridrich <[email protected]>
  • Loading branch information
gauron99 authored Sep 10, 2024
1 parent 1638f62 commit 92856e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/docker/creds/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ func setCredentialHelperToConfig(confFilePath, helper string) error {
if err != nil {
return err
}
// create config path if doesnt exist
err = os.MkdirAll(filepath.Dir(confFilePath), 0755)
if err != nil {
return err
}

err = os.WriteFile(confFilePath, data, 0600)
if err != nil {
Expand Down

0 comments on commit 92856e5

Please sign in to comment.