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

Lift configfile #757

Merged
merged 2 commits into from
Jan 18, 2023
Merged

Lift configfile #757

merged 2 commits into from
Jan 18, 2023

Conversation

ewollesen
Copy link
Contributor

Two smallish changes:

Lift configfile.ConfigFile out of CredentialsStore

Rather than assuming that users of CredentialStore will know to call Init
after instantiation, the CredentialStore's dependency on a Docker *ConfigFile
is made explicit by requiring it to be passed to the constructor. Now we need
never worry that a user will forget to call Init, and it removes the awkward
pattern of New-then-Init.

and:

Don't store the RegistryPuller's StorageClient

There's no point in storing it, as it's never reused.

Eric Wollesen added 2 commits January 17, 2023 16:49
There's no point in storing it, as it's never reused.
Rather than assuming that users of CredentialStore will know to call Init
after instantiation, the CredentialStore's dependency on a Docker *ConfigFile
is made explicit by requiring it to be passed to the constructor. Now we need
never worry that a user will forget to call Init, and it removes the awkward
pattern of New-then-Init.
@ewollesen ewollesen requested a review from TerryHowe January 18, 2023 00:02
@eks-distro-bot eks-distro-bot added approved size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 18, 2023
@ewollesen
Copy link
Contributor Author

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ewollesen

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

@ewollesen ewollesen mentioned this pull request Jan 18, 2023
@jonahjon
Copy link
Contributor

/lgtm

Looks like a good refactor

// CredentialStore for registry credentials such as ~/.docker/config.json.
type CredentialStore struct {
directory string
// DockerCredentialStore for Docker registry credentials, like ~/.docker/config.json.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is all fine, but I don't like docker in the name. I was trying to hide that. We don't have to be stuck with docker forever.

@vincentni
Copy link
Member

We may want to revisit this PR as bundle pulling failed due to 401 unauthorized access.

TerryHowe pushed a commit to TerryHowe/eks-anywhere-packages that referenced this pull request Jan 18, 2023
eks-distro-bot pushed a commit that referenced this pull request Jan 18, 2023
* Revert "Lift configfile (#757)"

This reverts commit de9c0be.

* Tone down error message
@ewollesen ewollesen deleted the lift-configfile branch January 18, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants