aws-deployment-framework icon indicating copy to clipboard operation
aws-deployment-framework copied to clipboard

Wrong key 'tag' in {'repository_arn': 'arn:aws:ecr:eu-west-1:012345678910:repository/test1', 'tag': 'standard-5.1'}

Open alkayahan opened this issue 4 years ago • 1 comments

Following the code below from the user manual for specifying a tag for the custom codebuild image.

pipelines:
  - name: example-custom-image
    default_providers:
      source:
        ...
      build:
        provider: codebuild
        image:
          repository_arn: arn:aws:ecr:region:012345678910:repository/test
          tag: latest #optional (and also defaults to latest)
    targets:

Which throws the following error

Key 'default_providers' error:
Key 'build' error:
Key 'properties' error:
Key 'image' error:
Or(<class 'str'>, {'repository_arn': <class 'str'>, Optional('tags'): <class 'dict'>}) did not validate {'repository_arn': 'arn:aws:ecr:eu-west-1:960715379967:repository/test1', 'tag': 'standard-5.1'}
{'repository_arn': 'arn:aws:ecr:eu-west-1:960715379967:repository/test1', 'tag': 'standard-5.1'} should be instance of 'str'
Wrong key 'tag' in {'repository_arn': 'arn:aws:ecr:eu-west-1:960715379967:repository/test1', 'tag': 'standard-5.1'} | (deployment_map.py:73)

I don't know why the respective source code is expecting a dict and not string for this field https://github.com/awslabs/aws-deployment-framework/blob/f9ffc7cb41012a9c8607907eccb96adf255b182d/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/schema_validation.py#L102

alkayahan avatar Jul 20 '21 19:07 alkayahan

Hi @alkayahan,

Thanks for reporting that. That seems to be a bug. I checked, the logic that is retrieving the image is using ‘tag’, not ‘tags’. So the sample is correct, and the schema is not. I will fix the issue.

Many thanks, Simon

sbkok avatar Jul 21 '21 10:07 sbkok

Thank you for your patience. I am happy to inform you that this issue has been resolved in our latest release v3.2.0 just now. I'm hereby closing this issue. Please open a new issue if you are experiencing any issues with the latest release.

sbkok avatar Jan 24 '23 10:01 sbkok