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

Implement both the Add and Delete operations as no-ops #847

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

therealvio
Copy link
Contributor

Issue #, if available: #102 & #154

Description of changes:

(Revive of #315)

Currently, both the Add and Delete operations in this helper return a not implemented error. This can lead to issues where docker login and docker logout stop working for the user while displaying a confusing not implemented error.

Following the suggestion in #154 (comment), this PR adds an environment variable (AWS_ECR_IGNORE_CREDS_STORAGE) to optionally ignore these requests and return no error. When AWS_ECR_IGNORE_CREDS_STORAGE=true, instead of returning a not implemented error, we return nil.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

dotboris and others added 5 commits July 25, 2023 11:04
These two operations are called when docker tries to store and delete
credentials (docker login and docker logout) respectively. This change
makes it so that both of these operations are implemented as nops
instead of returning a "not implemented" error.

The goal here is to ensure compatibilities with applications and tools
that call docker login or docker logout for the user as part of their
normal operations.
Co-authored-by: Gavin Inglis <43075615+ginglis13@users.noreply.github.com>
Copy link
Contributor

@swagatbora90 swagatbora90 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. This looks good to me. Few minor comments.

ecr-login/ecr.go Outdated Show resolved Hide resolved
ecr-login/ecr.go Outdated Show resolved Hide resolved
ecr-login/ecr.go Outdated Show resolved Hide resolved
ecr-login/ecr_test.go Outdated Show resolved Hide resolved
ecr-login/ecr.go Outdated Show resolved Hide resolved
@therealvio therealvio changed the title Implement both the Add and Delete operations as nops Implement both the Add and Delete operations as no-ops Jul 31, 2024
…login

With the new capability to opt-out of saving credentials, we can guide
users to not to save ecr credentials by setting the
AWS_ECR_IGNORE_CREDS_STORAGE environment variable when encountering the
`notImplemented` error.

Ref:
https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html
Copy link

@jamestelfer jamestelfer left a comment

Choose a reason for hiding this comment

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

LGTM @therealvio, thanks for picking this up for us! (Context, both @therealvio and I work at Culture Amp.)

Hopefully @swagatbora90 is happy with this too and we can improve our CI experience once this is released.

ecr-login/ecr.go Outdated Show resolved Hide resolved
ecr-login/ecr.go Outdated Show resolved Hide resolved
ecr-login/ecr_test.go Outdated Show resolved Hide resolved
ecr-login/ecr_test.go Outdated Show resolved Hide resolved
ecr-login/ecr_test.go Outdated Show resolved Hide resolved
This change fixes an incorrect use of the test's scope. The parent
was used for assertions and setting the env. This now should be using
the correct instance of the `*testing.T` for the test.
Copy link
Contributor

@swagatbora90 swagatbora90 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@therealvio
Copy link
Contributor Author

therealvio commented Aug 6, 2024

Approvals are in, and checks have passed. What do we need to do next to get this merged?

@austinvazquez austinvazquez merged commit 5ee6ab2 into awslabs:main Aug 7, 2024
14 checks passed
@austinvazquez
Copy link
Contributor

Done thanks @therealvio for pull this over the line.

@therealvio therealvio deleted the creds-add-delete-nop branch August 8, 2024 00:50
@therealvio
Copy link
Contributor Author

Thanks @austinvazquez, @swagatbora90 and @jamestelfer for your assistance on this 🙇 . I will mention the merge in the original thread for the original onlookers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants