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 login/logout for docker.io/vendor #763

Merged
merged 12 commits into from
Dec 3, 2021

Conversation

mtrmac
Copy link
Contributor

@mtrmac mtrmac commented Sep 11, 2021

This is an alternative to #757 , depends on UNMERGED containers/image#1373 .

Now that GetCredentials allows looking up namespaced credentials, use that instead of GetCredentialsForRef, which avoids the docker.io/vendordocker.io/library/vendor normalization issue; use reference parsing only to validate the syntax.

Also refactor a bit of the argument length handling and logout --all.

See individual commit messages for details.

Warning: Only unit-tested, and the actual functionality does not have test coverage. I didn’t actually try this in practice.

@mtrmac
Copy link
Contributor Author

mtrmac commented Oct 21, 2021

Warning: Only unit-tested, and the actual functionality does not have test coverage. I didn’t actually try this in practice.

Relying on login/logout tests in Podman , running in containers/podman#11538, for at least a smoke-test.

saschagrunert and others added 10 commits December 2, 2021 15:42
Signed-off-by: Sascha Grunert <[email protected]>
Signed-off-by: Miloslav Trmač <[email protected]>
Make the test fully table-driven now.

Signed-off-by: Miloslav Trmač <[email protected]>
The caller shouldn't care anyway.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Only test opts.All once instead of three times.

Don't even start worrying about key/registry with --all.

Signed-off-by: Miloslav Trmač <[email protected]>
This avoids duplication and non-obvious interactions (where "!= 0"
means "== 1"), and is more similar to Login.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
This allows looking up namespace credentials by
GetCredentials, and fixes GetAllCredentials to normalize
the returned keys.

Signed-off-by: Miloslav Trmač <[email protected]>
We can now call GetCredentials with namespaced keys,
so simplify.

The ref value is still computed, we'll remove that momentarily.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... and instead primarily use the string key.  This allows
using a docker.io/vendor namespace.

Also rename parseRegistryArgument to parseCredentialsKey,
the argument is not just a registry.

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac mtrmac marked this pull request as ready for review December 2, 2021 14:53
@mtrmac
Copy link
Contributor Author

mtrmac commented Dec 2, 2021

The c/image infrastructure was merged, so this is ready for review.

@rhatdan
Copy link
Member

rhatdan commented Dec 2, 2021

/approve

@openshift-ci openshift-ci bot added the approved label Dec 2, 2021
@rhatdan
Copy link
Member

rhatdan commented Dec 3, 2021

LGTM
@vrothberg PTAL

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
Copy link
Contributor

openshift-ci bot commented Dec 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac, 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:

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 48ce2e1 into containers:main Dec 3, 2021
@mtrmac mtrmac deleted the docker.io-vendor branch December 3, 2021 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants