-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Don't panic on podman4 machine configs #21573
Conversation
} | ||
|
||
func (err *ErrIncompatibleMachineConfig) Error() string { | ||
return fmt.Sprintf("incompatible machine config %q (%s) for this version of Podman", err.Path, err.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
registry.SetExitCode(os.ENOTSUP) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, we we also use this to emit a soft error ... the use case is like podman machine ls
; as it is walking the dir for JSON files, it tries to read one; if we detect that this is an old config (version 0), we emit a soft error but continue on ... assuming we list another machine, it seems reasonable that the error code is 0 (meaning the ls worked).
In all other cases, where the VM name is provided (we are not walking a dir looking for files), then we do hard error and yes, in that case we could set the return code.
i think we have options to explore, for example, if the code above worked, we could make the soft error just a fmt.errorf instead of calling this actual error (the message could be the same). That way, again if the above worked, it would set the code.
thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, some small comments for the test
LGTM. Validate is angry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: baude, flouthoc 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 |
we should not panic podman when it has to deal with a podman4 machine config. instead, we throw a soft error for `machine ls` and in all other cases, we throw a hard error stating that the machine config is incompatible. a future PR will provide instructions on how to recover from this. current idea is something like `podman machine reset` which blows everything away machine-wise. Signed-off-by: Brent Baude <bbaude@redhat.com>
/lgtm |
wait on #21597 before removing hold |
/hold cancel |
we should not panic podman when it has to deal with a podman4 machine config. instead, we throw a soft error for
machine ls
and in all other cases, we throw a hard error stating that the machine config is incompatible.a future PR will provide instructions on how to recover from this. current idea is something like
podman machine reset
which blows everything away machine-wise.Does this PR introduce a user-facing change?