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

Fix --arch and --os flags to work correctly #9084

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jan 25, 2021

Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os. No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch. This PR also fixes this issue.

Fixes: #8001

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 25, 2021
@rhatdan
Copy link
Member Author

rhatdan commented Jan 25, 2021

@lisongmin PTAL

"use `ARCH` instead of the architecture of the machine for choosing images",
)
_ = cmd.RegisterFlagCompletionFunc(overrideArchFlagName, completion.AutocompleteNone)
_ = cmd.RegisterFlagCompletionFunc(archFlagName, completion.AutocompleteNone)
Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly you added autocomplete functions for arch and os. It would be good if you add them here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reminding me.

Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os.  No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch.  This PR also fixes this issue.

Fixes: containers#8001

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Member Author

rhatdan commented Jan 25, 2021

@containers/podman-maintainers PTAL

@TomSweeneyRedHat
Copy link
Member

LGTM
assuming happy testst

@edsantiago
Copy link
Member

LGTM but all I can give it right now is a cursory once-over. FWIW I did run my usual ack override- and ack '\.Override' (ack is a nice grep -r) to look for strays: none found. Nice.

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [rhatdan,saschagrunert]

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

@vrothberg
Copy link
Member

/hold

I doubt that this change fixes #8001. Will test a bit.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 26, 2021
cliVals.OverrideOS = split[0]
if len(split) > 1 {
cliVals.OverrideArch = split[1]
if cliVals.Platform != "" || cliVals.Arch != "" || cliVals.OS != "" {
Copy link
Member

Choose a reason for hiding this comment

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

@rhatdan can you add a // FIXME that states that all this logic should go into the backend? While this fix works for the clients, it does not work for the server.

I'd prefer something similar to vrothberg@6aa9622 but I never managed to get back to it. I would love to remove the pull entirely (as the backend does that already) but that would lose the progress bars for the remote client.

Copy link
Member Author

Choose a reason for hiding this comment

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

When we do the containers/common image, could we take care of this there?

Copy link
Member

@vrothberg vrothberg Jan 26, 2021

Choose a reason for hiding this comment

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

Yes we could do that. But that would be based on libpod/image which is currently not doing what it should. That's why I think that vrothberg@6aa9622 is closer to tackle the root of the problem.

@vrothberg
Copy link
Member

I doubt that this change fixes #8001. Will test a bit.

Looking good 👍

@rhatdan rhatdan added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jan 26, 2021
@openshift-merge-robot openshift-merge-robot merged commit e5e447d into containers:master Jan 26, 2021
@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 Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
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.
Projects
None yet
8 participants