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): fix repeated deploys of stacks with tar assets #23497

Merged
merged 2 commits into from
Feb 28, 2023

Commits on Feb 28, 2023

  1. fix(ecr-assets): fix repeated deploys of stacks with tar assets

    The current implementation fails because it assumes the output of
    `docker load` can only be
    
    ```
    Loaded Image: {image}
    ```
    
    However, if docker has to take any actions (such as untagging a previous
    image) the output will look like
    
    ```
    {error message}
    {error message}
    Loaded Image: {image}
    ```
    
    To fix this, we can simply take the last line of the output via `tail`
    before we attempt to extract the image. If the last line isn't of the
    correct form, this will fail in an effectively equivalent way to how it
    failed previously.
    
    A previous attempt at fixing this (aws#18823) used a more complicated `sed`
    command which used a cli flag that is not consistently available. This
    approach won't work on all platforms (ex. macos) and is also much less
    clear that it's correct.
    
    This change also adds an integration test that tests the tarbell stack, though
    it doesn't test the repeated deploy automatically. I have tested that by
    running the integration test multiple times with an image modification in
    between. We also vendor the tarball of the hello-world docker image, which
    results in ~10kb of additional data in the repo. This is about as small as we
    can get a vendored image with as straightforward a vendoring process.
    
    fixes aws#18822
    dastbe committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    eb45b05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c7ccff0 View commit details
    Browse the repository at this point in the history