Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a call to MkdirAll for the credentials directory path. #381

Merged

Conversation

jeremyrickard
Copy link
Contributor

This adds a call to MkdirAll with the credentials path before we attempt to write the credential file. This will ensure that the credential directory exists before we try and write the file. If the directory exists already, it's a NO-OP.

Fixes #377

This adds a call to MkdirAll with the credentials path before we
attempt to write the credential file. This will ensure that the
credential directory exists before we try and write the file. If the
directory exists already, it's a NO-OP.

Fixes getporter#377
@jeremyrickard jeremyrickard requested a review from vdice June 5, 2019 15:45
@jeremyrickard jeremyrickard self-assigned this Jun 5, 2019
pkg/porter/credentials_test.go Show resolved Hide resolved
}
// Make the credentials path if it doesn't exist. MkdirAll does nothing if it already exists
// Readable, writable only by the user
err = p.Config.FileSystem.MkdirAll(credentialsDir, 0700)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't handling the error, can you add that quick?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeahhhh i have that in a commit i noticed it wasn't there after i pusheddddd

@jeremyrickard jeremyrickard merged commit 0fc8d10 into getporter:master Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

porter credentials generate fails with no directory found
3 participants