Skip to content

Conversation

@jpower432
Copy link
Contributor

@jpower432 jpower432 commented Jan 13, 2022

Adds podman default credential location as an alternate location
when loading the config for registry resolver

Signed-off-by: Jennifer Power barnabei.jennifer@gmail.com

Description of the change:
This PR changes the containerd registry resolver to use docker well-known credential locations as a primary credential location for registry authentication and uses the podman location as an alternative.

Motivation for the change:
The motivation for this change is to allow podman users to use the default location as a credential location and to help resolve an issue in oc-mirror

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Adds podman default credential location as an alternate location
when loading the config for containerd registry resolver

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2022

Hi @jpower432. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 13, 2022
@openshift-ci openshift-ci bot requested review from benluddy and kevinrizza January 13, 2022 22:03
@jpower432
Copy link
Contributor Author

cc @dinhxuanvu

@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #897 (5b68736) into master (611525b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #897   +/-   ##
=======================================
  Coverage   52.07%   52.07%           
=======================================
  Files         103      103           
  Lines        9092     9092           
=======================================
  Hits         4735     4735           
  Misses       3449     3449           
  Partials      908      908           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 611525b...5b68736. Read the comment docs.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Nice!

Just a few comments/questions.

Comment on lines +98 to +99
switch _, err := os.Stat(dockerConfigJSON); {
case err == nil:
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to always attempt to read both files and then merge them?

Copy link
Member

Choose a reason for hiding this comment

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

@jpower432 Any thoughts on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no function in the config library that I saw capable of merging, but I could write a helper function to merge the two configs. I definitely think that it would cover more use cases, but we would have to have a preferred option when merging. Assuming we would use the docker config as the preferred option?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah favoring the docker config option makes sense so we avoid breaking people that already have both and have different credentials for the same registry in the podman auth file.

Copy link
Member

Choose a reason for hiding this comment

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

This is a nit, btw. If its hard to do, I don't consider it a must-have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. I don't believe it would be overly complicated, but I would like to tackle it in a follow-on PR if that works.

@dinhxuanvu
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 14, 2022
…ross-platform option

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

Approved.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, jpower432

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2022
@dinhxuanvu
Copy link
Member

@joelanford May you bless this with a lgtm? ;)

@joelanford
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2022
@openshift-merge-robot openshift-merge-robot merged commit c056ac1 into operator-framework:master Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants