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

fix(ecr-assets): improved compatiblity of TarballImageAsset with different docker versions #33430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajaest
Copy link

@ajaest ajaest commented Feb 13, 2025

Issue

Closes #33428

Reason for this change

The problem seems to be the sed expression used here, that expects docker load output to match the expression Loaded image: <digest>.

However, in the attached docker version docker load actually prints Loaded image ID: <digest>.

Just changing the sed expression from sed "s/Loaded image: //g" to sed "s/Loaded image[^:]*: //g" or similar should work for every scenario. For example:

$> echo 'Loaded image ID: sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a'| sed  "s/Loaded image[^:]*: //g"
sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a

$> echo 'Loaded image: sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a'| sed  "s/Loaded image[^:]*: //g"
sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a

Description of changes

Changed the sed expression to obtain the imported tarball digest from sed "s/Loaded image: //g" to sed "s/Loaded image[^:]*: //g"

Describe any new or updated permissions being added

No permissions addeed

Description of how you validated changes

I run the sed expression against the original expected output and the one from the latest docker clients:

$> echo 'Loaded image ID: sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a'| sed  "s/Loaded image[^:]*: //g"
sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a

$> echo 'Loaded image: sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a'| sed  "s/Loaded image[^:]*: //g"
sha256:4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a

Checklist


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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p2 labels Feb 13, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 13, 2025 11:24
@ajaest ajaest force-pushed the fix/33428-tarball-asset-failing branch from f340052 to ac58e41 Compare February 13, 2025 11:25
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter fails with the following errors:

❌ Fixes must contain a change to a test file.
❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ac58e41
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing

To prevent automatic closure:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@aws-cdk/aws-ecr-assets: TarballImageAsset is not properly docker-loading image with docker 27.4
2 participants