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

refactor: add sshClient function #23893

Merged

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Sep 7, 2024

The ssh options needs some weird parameters like (the raw) uri and machine (insecure), so it is not enough with url and identity.

i.e. it is not the generic "ssh", but the containers/common "ssh"

The "secure" query parameter was removed in Podman v4.3, it is now replaced with the "machine" option parameter (InsecureIgnoreHostKey)

commit 280f5d8

I think that url.Parse will fail to add any url.Port that is not an integer, so the strconv.Atoi error probably can never happen?

But since it is only a validation error and not a connection error, it cannot be wrapped in a ConnectError so that goes into function.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 7, 2024
@afbjorklund
Copy link
Contributor Author

@afbjorklund afbjorklund force-pushed the ssh-config-refactor branch 2 times, most recently from 7b20ef5 to 8e8582d Compare September 8, 2024 11:48
@afbjorklund afbjorklund marked this pull request as ready for review September 8, 2024 11:53
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2024
@baude baude added the No New Tests Allow PR to proceed without adding regression tests label Sep 9, 2024
pkg/bindings/connection.go Outdated Show resolved Hide resolved
@baude
Copy link
Member

baude commented Sep 9, 2024

code looks ok to me, couple of questions.

The ssh options needs some weird parameters like (the raw) uri
and machine (insecure), so it is not enough with url and identity.

The "secure" query parameter was removed in Podman v4.3, it is now
replaced with the "machine" option parameter (InsecureIgnoreHostKey)

I think that url.Parse will fail to add any url.Port that is not
an integer, so the strconv.Atoi error probably can never happen?

But since it is only a validation error and not a connection error,
it cannot be wrapped in a ConnectError so that goes into function.

Signed-off-by: Anders F Björklund <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Sep 10, 2024

/approve
/lgtm
Thanks @afbjorklund

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2024
Copy link
Contributor

openshift-ci bot commented Sep 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund, rhatdan

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 10, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit b1efc50 into containers:main Sep 10, 2024
80 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Dec 10, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. No New Tests Allow PR to proceed without adding regression tests release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants