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

auto-update: validate container image #15933

Merged
merged 1 commit into from Sep 26, 2022

Conversation

vrothberg
Copy link
Member

@vrothberg vrothberg commented Sep 26, 2022

Auto updates require containers to be created with a fully-qualified image reference. Short names are not supported due the ambiguity of their source registry. Initially, container creation errored out for non FQN images but it seems that Podman has regressed.

Fixes: #15879
Signed-off-by: Valentin Rothberg vrothberg@redhat.com

Does this PR introduce a user-facing change?

Auto update: error out on container creation for non-FQN images.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 26, 2022
@vrothberg
Copy link
Member Author

@rhatdan @mheon PTAL

Copy link
Collaborator

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Minor nits adding up.

Also... the first half of the test is actually applicable to podman-remote, but it is not run (all tests in this bats file are skipped on remote). Would there be any point to moving this test to another bats file? (My inclination is no, but I think it's worth an explicit decision)

test/system/255-auto-update.bats Outdated Show resolved Hide resolved
test/system/255-auto-update.bats Outdated Show resolved Hide resolved
test/system/255-auto-update.bats Outdated Show resolved Hide resolved
test/system/255-auto-update.bats Outdated Show resolved Hide resolved
test/system/255-auto-update.bats Show resolved Hide resolved
@vrothberg
Copy link
Member Author

Thanks for the review, @edsantiago! Wow, how much a phone call can distract me.

@vrothberg
Copy link
Member Author

Would there be any point to moving this test to another bats file? (My inclination is no, but I think it's worth an explicit decision)

I do not feel strongly either way. If you have a preference, I happily move the test around.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 26, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, vrothberg

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 [edsantiago,vrothberg]

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

@edsantiago
Copy link
Collaborator

Is there any conceivable situation in which this could happen?

# podman create --label ... shortname:latest
Error: you can't do that
# podman-remote !*
[runs just fine]

I'm guessing no. But if there is any possible code flow where that could pass, then it might be worth adding a regression test.

@vrothberg
Copy link
Member Author

Is there any conceivable situation in which this could happen?

No, there is none to my knowledge. There are various ways to create a container but all will be validated. That's why I moved it there. Initially, the check was in specgen which clearly broke at some point (also due to the missing tests).

@rhatdan
Copy link
Member

rhatdan commented Sep 26, 2022

LGTM

@mheon
Copy link
Member

mheon commented Sep 26, 2022

LGTM. Tests are red.

@vrothberg
Copy link
Member Author

LGTM. Tests are red.

Fixed. There was a redundant test that I removed. @edsantiago, can you give your blessing for that?

@rhatdan
Copy link
Member

rhatdan commented Sep 26, 2022

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2022
@edsantiago
Copy link
Collaborator

edsantiago commented Sep 26, 2022

OK hold on: is it intentional to revert #10063 then? Because it looks like that PR was deliberate. And if that will be reverted, it looks like we need many more reversions, such as to the man pages and the code?

@vrothberg
Copy link
Member Author

OK hold on: is it intentional to revert #10063 then? Because it looks like that PR was deliberate. And if that will be reverted, it looks like we need many more reversions, such as to the man pages and the code?

That is a fair point. It would break backwards compat as the "local" policy allows short names. In retrospect, I think that was a bad idea but that doesn't justify breaking things. Thank you for catching, Ed.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2022
Auto updates using the "registry" policy require container to be created
with a fully-qualified image reference.  Short names are not supported
due the ambiguity of their source registry.  Initially, container
creation errored out for non FQN images but it seems that Podman has
regressed.

Fixes: containers#15879
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Sep 26, 2022

/lgtm
/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2022
@edsantiago
Copy link
Collaborator

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2022
@openshift-merge-robot openshift-merge-robot merged commit a0c0971 into containers:main Sep 26, 2022
@vrothberg vrothberg deleted the fix-15879 branch September 27, 2022 08:06
@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman auto-update: reject short image names on container creation
5 participants