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

Add --insecure flag to podman manifest inspect for Docker compatibility #15359

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 17, 2022

Helps fix: #14917

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

Does this PR introduce a user-facing change?

podman manifest inspect now supports --insecure flag for Docker compatibility

@openshift-ci openshift-ci bot added do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note and removed do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Aug 17, 2022

run_podman manifest create --insecure test:1.0
run_podman images --format '{{.ID}}' --no-trunc
[[ "$output" == *"sha256:$iid"* ]]
Copy link
Member

Choose a reason for hiding this comment

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

Aaaaaaaahhhhhh! Evil! I must never have reviewed the initial commit. Please fix this to

    assert "$output" =~ "sha256:$iid" "Original image ID still shown in podman-images output"


run_podman manifest create test:1.0
run_podman manifest inspect --insecure $output
is "$output" ".*\"mediaType\": \"application/vnd.docker.distribution.manifest.list.v2+json\"" "Original image ID still shown in podman-images output"
Copy link
Member

Choose a reason for hiding this comment

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

Nice addition, but comment ("Original image ID...") is misleading. Probably not worth the CI cost to re-push, but if you do, could you also add a comment something like "# --insecure is a NOP, we use it here just to make sure podman accepts it"

@@ -33,8 +33,17 @@ func (ir *ImageEngine) ManifestExists(ctx context.Context, name string) (*entiti
}

// ManifestInspect returns contents of manifest list with given name
func (ir *ImageEngine) ManifestInspect(_ context.Context, name string) ([]byte, error) {
list, err := manifests.Inspect(ir.ClientCtx, name, nil)
func (ir *ImageEngine) ManifestInspect(ctx context.Context, name string, opts entities.ImageSearchOptions) ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this reusing a different method's options structure instead of rolling its own, as most of the others in this file that take options structures do?

Copy link
Member Author

@rhatdan rhatdan Aug 26, 2022

Choose a reason for hiding this comment

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

laziness?

iid=$output

run_podman manifest create test:1.0
run_podman manifest inspect --insecure $output
Copy link
Member

Choose a reason for hiding this comment

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

$output looks like it'll be the local manifest's ID, which I wouldn't expect us to ask a registry about. Is this testing the right thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was just checking that --insecure option would work, not testing against an insecure registry. Do we have an insecure registry to test against?

Copy link
Member

Choose a reason for hiding this comment

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

The podman login tests fire up a registry container with TLS configured. If we did that here, so long as the client isn't configured to trust the CA certificate (HTTPS, but not verifiable), or there is no certificate (plain old HTTP), a client will have to have a working --insecure flag in order to be able to talk to it at all. But we'd have to be looking for an image using a name rather than an ID.

@github-actions
Copy link

github-actions bot commented Oct 9, 2022

A friendly reminder that this PR had no activity for 30 days.

@rhatdan rhatdan removed the stale-pr label Oct 10, 2022
@rhatdan rhatdan force-pushed the manifest branch 2 times, most recently from 51a77d5 to 0bf64b1 Compare October 31, 2022 14:15
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Oct 31, 2022
@rhatdan rhatdan force-pushed the manifest branch 5 times, most recently from 798a420 to adc69a8 Compare November 1, 2022 17:48
@rhatdan
Copy link
Member Author

rhatdan commented Nov 1, 2022

@containers/podman-maintainers PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Nov 1, 2022

@vrothberg @mheon @edsantiago PTAL

Copy link
Member

@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.

Ugh, looks like I need to write a new CI check. For now, can you please:

  • git rm docs/source/markdown/podman-manifest-instpect.1.md
  • manually add podman-manifest-inspect.1.md to the file docs/source/markdown/.gitignore (preferably in sorted order)
  • re-push

Otherwise LGTM, although all I reviewed was docs & tests.

--insecure and --verbose flags for docker compatibility

--tls-verify for syntax compatibility and allow users to inspect
manifests at remote Container Registiries without requiring tls.

Helps fix: containers#14917

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

CI is finally green (lots o' flakes). LGTM but this needs more approval than just mine.

Copy link
Member

@vrothberg vrothberg 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 4, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, rhatdan, 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,rhatdan,vrothberg]

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

@openshift-merge-robot openshift-merge-robot merged commit 0702b4c into containers:main Nov 4, 2022
@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. kind/api-change Change to remote API; merits scrutiny 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.

man pages: docker differences
6 participants