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

Ignore the error when running podman machine ssh <command> #21207

Merged

Conversation

tnk4on
Copy link
Contributor

@tnk4on tnk4on commented Jan 9, 2024

Fixes the error that occurs when executing a command without a machine name when using podman-machine-default.
Fixes: #21183 (and fix PR #21114)

[NO NEW TESTS NEEDED]

Does this PR introduce a user-facing change?

None

@@ -57,10 +57,8 @@ func ssh(cmd *cobra.Command, args []string) error {
// provided the VM name. If so, we check. The VM name,
// if provided, must be in args[0].
if len(args) > 0 {
// Ignore the error, See https://github.com/containers/podman/issues/21183#issuecomment-1879713572
validVM, err = provider.IsValidVMName(args[0])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
validVM, err = provider.IsValidVMName(args[0])
validVM, _ = provider.IsValidVMName(args[0])

To pass the linter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fix the code as suggested.

@mheon
Copy link
Member

mheon commented Jan 9, 2024

LGTM once comment is addressed

@tnk4on tnk4on force-pushed the fix-podman-machine-ssh-command branch from a1e3ff2 to 83fa484 Compare January 10, 2024 05:32
@rhatdan
Copy link
Member

rhatdan commented Jan 10, 2024

/approve
/lgtm

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

openshift-ci bot commented Jan 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jan 10, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit adaf3ca into containers:main Jan 10, 2024
91 of 92 checks passed
@tnk4on tnk4on deleted the fix-podman-machine-ssh-command branch January 10, 2024 12:09
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Apr 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 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. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VM does not exist error with ssh command on applehv podman machine
4 participants