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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read pwd from non-tty input #996

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Conversation

matejvasek
Copy link
Contributor

Changes

  • 馃悰 docker credentials can be now read from non-tty stdin (e.g. from piped input).

/kind bug

Release Note

fix: docker credentials can be now read from non-tty stdin (e.g. from piped input)

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 27, 2022
@knative-prow knative-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 27, 2022
@knative-prow
Copy link

knative-prow bot commented Apr 27, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2022
@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #996 (9994d8a) into main (b79683c) will increase coverage by 0.44%.
The diff coverage is 70.73%.

@@            Coverage Diff             @@
##             main     #996      +/-   ##
==========================================
+ Coverage   46.27%   46.71%   +0.44%     
==========================================
  Files          57       57              
  Lines        7475     7505      +30     
==========================================
+ Hits         3459     3506      +47     
+ Misses       3689     3669      -20     
- Partials      327      330       +3     
Impacted Files Coverage 螖
cmd/deploy.go 56.81% <70.00%> (+10.77%) 猬嗭笍
cmd/client.go 81.53% <100.00%> (酶)

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update b79683c...9994d8a. Read the comment docs.

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

Could a test be added for this?

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 28, 2022
@matejvasek matejvasek force-pushed the non-it-prompt branch 2 times, most recently from ddb7668 to e774064 Compare April 28, 2022 01:02
Signed-off-by: Matej Vasek <mvasek@redhat.com>
@matejvasek
Copy link
Contributor Author

@lance test added.

@matejvasek matejvasek requested a review from lance April 28, 2022 01:23
Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

Just a couple of questions. Overall looks good. Thanks for adding the test!

/lgtm

}()

go func() {
chars := expectedCreds.Username + enter + expectedCreds.Password + enter
Copy link
Member

Choose a reason for hiding this comment

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

@matejvasek sorry for my ignorance here, but where does enter come from? I only see it twice in this file and it appears to be uninitalized, but I know that can't be the case or it would not compile.

chars := expectedCreds.Username + enter + expectedCreds.Password + enter
for _, ch := range chars {
_, _ = console.Send(string(ch))
time.Sleep(time.Millisecond * 50)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to sleep here?

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2022
@knative-prow knative-prow bot merged commit e9932cd into knative:main Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants