← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~pappacena/launchpad:upgrade-boto into launchpad:master

 

Review: Approve



Diff comments:

> diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
> index 4d51843..923f670 100644
> --- a/lib/lp/oci/model/ociregistryclient.py
> +++ b/lib/lp/oci/model/ociregistryclient.py
> @@ -680,23 +680,13 @@ class AWSAuthenticatorMixin:
>  
>      def _getBotoClient(self):
>          params = self._getClientParameters()
> -        if not self.should_use_aws_extra_model:
> -            return boto3.client('ecr', **params)
> -        model_path = getFeatureFlag(OCI_AWS_BOT_EXTRA_MODEL_PATH)
> -        model_name = getFeatureFlag(OCI_AWS_BOT_EXTRA_MODEL_NAME)
> -        if not model_path or not model_name:
> -            log.warning(
> -                "%s or %s feature rules are not set. Using default model." %
> -                (OCI_AWS_BOT_EXTRA_MODEL_PATH, OCI_AWS_BOT_EXTRA_MODEL_NAME))
> -            return boto3.client('ecr', **params)
> -        session = boto3.Session()
> -        session._loader.search_paths.extend([model_path])
> -        return session.client(model_name, **params)
> +        client_type = 'ecr-public' if self.is_public_ecr else 'ecr'
> +        return boto3.client(client_type, **params)
>  
>      @property
> -    def should_use_aws_extra_model(self):
> -        """Returns True if the given registry domain requires extra boto API
> -        model.
> +    def is_public_ecr(self):
> +        """Returns True if the given registry domain is a public ECR. False
> +        otherwhise.

"otherwise"

>          """
>          domain = urlparse(self.push_rule.registry_url).netloc
>          return is_aws_bearer_token_domain(domain)


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/400419
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:upgrade-boto.


References