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 Amazon Elastic Container Registry (ECR) Hook #28279

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

Taragolis
Copy link
Contributor

Pre-requirements for #26162

Add new Hook into amazon-provider which integrated with ECR.

Hook itself it is just Thin wrapper around boto3 ECR client with single method for:

  • Obtain temporary credentials
  • Decode them
  • Mask password
  • Prepare to use with docker login

Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

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

Just a nit and a question, otherwise looks good!

- `boto3 ECR client get_authorization_token method <https://boto3.amazonaws.com/v1/documentation/\
api/latest/reference/services/ecr.html#ECR.Client.get_authorization_token>`_.
"""
registry_ids = registry_ids or None
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just to guard empty string/list as an input? Because you are already defaulting this to None in the method signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, just a guard. This attribute will propagated from connection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So value in some cases might be "" just for avoid this situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@o-nikolas @ferruzzi do we have any concern about this part? Or we could merge this changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah no concern I was just checking to be sure. You could re-arrange the if statements so that the falsey check happens first so that you wouldn't need this assignment, but the way you have it is also perfectly fine 👍

airflow/providers/amazon/aws/hooks/ecr.py Outdated Show resolved Hide resolved
Co-authored-by: D. Ferruzzi <ferruzzi@amazon.com>
Co-authored-by: Niko <onikolas@amazon.com>
@Taragolis Taragolis merged commit 8e0df88 into apache:main Dec 17, 2022
@Taragolis Taragolis deleted the amazon-ecr-hook branch December 17, 2022 01:40
gschuurman pushed a commit to gschuurman/airflow that referenced this pull request Dec 19, 2022
Co-authored-by: D. Ferruzzi <ferruzzi@amazon.com>
Co-authored-by: Niko <onikolas@amazon.com>
@pierrejeambrun pierrejeambrun added this to the Airflow 2.6.0 milestone Jan 9, 2023
@pierrejeambrun pierrejeambrun added the type:new-feature Changelog: New Features label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants