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

Prompt for un/pwd if not supplied with --creds #415

Merged
merged 1 commit into from
Jan 27, 2018

Conversation

TomSweeneyRedHat
Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat commented Jan 24, 2018

Signed-off-by: TomSweeneyRedHat [email protected]

If either the username or password is not supplied with the --creds parameter for Buildah, the user will be prompted to input either or both of them. The value entered for the username is echo'd back to the user, the password is not.

Samples

# buildah from --creds "" docker.io/tomsweeneyredhat/testing:first
Username: tomsweeneyredhat
Password: 
Getting image source signatures
Copying blob sha256:188ab0d3421d19d043df1ec825d5d9faddf21083a8f3daff73aa438195136f2f
 7.07 MiB / 64.07 MiB [======>-------------------------------------------------]^C
# 
# buildah from --creds "tomsweeneyredhat" docker.io/tomsweeneyredhat/testing:first
Password: 
Getting image source signatures
Copying blob sha256:188ab0d3421d19d043df1ec825d5d9faddf21083a8f3daff73aa438195136f2f
 2.96 MiB / 64.07 MiB [==>-----------------------------------------------------]^C
# 
# buildah from --creds "tomsweeneyredhat:" docker.io/tomsweeneyredhat/testing:first
Password: 
Getting image source signatures
Copying blob sha256:188ab0d3421d19d043df1ec825d5d9faddf21083a8f3daff73aa438195136f2f
 7.37 MiB / 64.07 MiB [======>-------------------------------------------------]^C
# 
# buildah from --creds ":testpassword" docker.io/tomsweeneyredhat/testing:first
Username: tomsweeneyredhat
Getting image source signatures
Copying blob sha256:188ab0d3421d19d043df1ec825d5d9faddf21083a8f3daff73aa438195136f2f
 4.69 MiB / 64.07 MiB [====>---------------------------------------------------]^C
# 
# buildah from --creds tomsweeneyredhat:testpassword docker.io/tomsweeneyredhat/testing:first
Getting image source signatures
Copying blob sha256:188ab0d3421d19d043df1ec825d5d9faddf21083a8f3daff73aa438195136f2f
 4.63 MiB / 64.07 MiB [====>---------------------------------------------------]^C

@boaz0
Copy link
Collaborator

boaz0 commented Jan 24, 2018

Failure is due to:

Error: source files are not formatted according to recommendations. Run "gofmt -s -w" on

Copy link
Collaborator

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

"time"

"golang.org/x/crypto/ssh/terminal"

Copy link
Member

Choose a reason for hiding this comment

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

Remove extra line.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@rhatdan
Copy link
Member

rhatdan commented Jan 25, 2018

LGTM once yoiu fix the gofmt error.

@@ -148,14 +149,14 @@ func systemContextFromOptions(c *cli.Context) (*types.SystemContext, error) {

func parseCreds(creds string) (string, string, error) {
if creds == "" {
return "", "", errors.Wrapf(syscall.EINVAL, "credentials can't be empty")
return "", "", nil
Copy link
Member Author

Choose a reason for hiding this comment

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

just noted we're always returning a nil error, I"m going to yank that out. New patch shortly.

@TomSweeneyRedHat TomSweeneyRedHat force-pushed the dev/tsweeney/pwdprompt branch 3 times, most recently from 8da7ef6 to d302161 Compare January 25, 2018 19:32
@TomSweeneyRedHat
Copy link
Member Author

Closing to reopen/retest. Travis is blowing up with a network error which I think is unrelated.

@TomSweeneyRedHat
Copy link
Member Author

Finally happy green buttons!

@rhatdan
Copy link
Member

rhatdan commented Jan 26, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 7dc787a has been approved by rhatdan

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 7dc787a with merge 4981b32...

rh-atomic-bot pushed a commit that referenced this pull request Jan 26, 2018
Signed-off-by: TomSweeneyRedHat <[email protected]>

Closes: #415
Approved by: rhatdan
@TomSweeneyRedHat
Copy link
Member Author

homu hasn't completed in 8 hours?

@rh-atomic-bot
Copy link
Collaborator

💥 Test timed out

@TomSweeneyRedHat
Copy link
Member Author

closing to reopen/retest. homu timed out after 10+ hours.

@TomSweeneyRedHat
Copy link
Member Author

@rhatdan @nalind I'm stumped, homu keeps timing out. Is this good to merge as is? If not suggestions on what to tweak?

@rhatdan
Copy link
Member

rhatdan commented Jan 27, 2018

I just manually merge it when Humu is acting up.

@rhatdan rhatdan merged commit d0e1ad1 into containers:master Jan 27, 2018
@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/pwdprompt branch January 27, 2018 15:23
@TomSweeneyRedHat
Copy link
Member Author

Fixs #256

@cevich cevich mentioned this pull request Aug 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants