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

applehv: return socket path from setupAPIForwarding #21264

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

cfergeau
Copy link
Contributor

@cfergeau cfergeau commented Jan 16, 2024

When starting podman machine with applehv, this warning is printed:
WARN[0025] API socket failed ping test

This is due to a bug in applehv.setupAPIForwarding which is not returning
the path to the socket, which causes WaitAndPingAPI to be called with
"" as the socket path, triggering the warning.

This commit changes setupAPIForwarding to be similar to the implementation
in the other machine implementations.

Does this PR introduce a user-facing change?

none

@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Jan 16, 2024
@openshift-ci openshift-ci bot added release-note-none and removed do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Jan 16, 2024
@mheon
Copy link
Member

mheon commented Jan 16, 2024

Needs a test or [NO NEW TESTS NEEDED]

@cfergeau
Copy link
Contributor Author

Needs a test or [NO NEW TESTS NEEDED]

I don't know how to add a test for it, if you have pointers I can look into it.
However, it's more usefully tested in an end-to-end podman-machine scenario, as this bug means there's always a warning when running podman machine start with applehv, so I'd lean towards just adding [NO NEW TESTS NEEDED]

`applehv.Start()` has this line of code:
```
cmd.ExtraFiles = []*os.File{ioEater, ioEater, ioEater}
```
whose purpose is not clear.

The intent may have been to redirect stdin/stdout/stderr to /dev/null in
the child process.
This should be done by setting cmd.Stdin/cmd.Stdout/cmd/Stderr to nil,
which is the case by default.

The way it's done could also cause issues as
`Vfkit.VirtualMachine.Cmd()` sometimes adds files it needs to keep open
to `ExtraFiles`, so at the very least this should be an `append()`

This commit removes this code.

[NO NEW TESTS NEEDED]

Signed-off-by: Christophe Fergeau <[email protected]>
When starting podman machine with applehv, this warning is printed:
WARN[0025] API socket failed ping test

This is due to a bug in applehv.setupAPIForwarding which is not
returning the path to the socket, which causes `WaitAndPingAPI` to be
called with `""` as the socket path, triggering the warning.

This commit changes setupAPIForwarding to be similar to the
implementation in the other machine implementations.

I don't know how to add a test for this, but this can be handled in
podman-machine end to end tests by making sure that there are no
warnings when running `podman machine start` with applehv.

[NO NEW TESTS NEEDED]

Signed-off-by: Christophe Fergeau <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jan 18, 2024

/approve
/lgtm

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

openshift-ci bot commented Jan 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau, 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 Jan 18, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 597ff52 into containers:main Jan 18, 2024
91 of 92 checks passed
@ashley-cui
Copy link
Member

/cherry-pick v4.9

@openshift-cherrypick-robot
Copy link
Collaborator

@ashley-cui: new pull request created: #21437

In response to this:

/cherry-pick v4.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@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 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 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. machine release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants