Skip to content

Commit

Permalink
Adding fix for publishing recipes to ECR (radius-project#7887)
Browse files Browse the repository at this point in the history
# Description

ECR thorws following error when Data is nil, updating the data to a
empty descriptor.
```
Something went wrong Cause: PUT "
https://<account-name>.dkr.ecr.us-east-2.amazonaws.com/v2/test-private-ecr/blobs/uploads/47552bfb-e8f7-41ad-9c07-310446dc14?digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb927ae41e4649b934ca495991b7852b855":
response status code 400: blob upload invalid: The upload with id '47552bfb-e8f7-41ad-9c07-314186dc14' in the repository with name 'test-ecr' in registry with id '<account-name>' cannot be completed because it does not have any parts.
```

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: radius-project#7855

---------

Signed-off-by: Vishwanath Hiremath <vhiremath@microsoft.com>
  • Loading branch information
vishwahiremat authored Sep 5, 2024
1 parent 9091f8b commit dca3a27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cli/cmd/bicep/publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ func (r *Runner) prepareSource(ctx context.Context) (*memory.Store, error) {
}

// Push config blob
configDesc, err := pushBlob(ctx, configMediaType, nil, src)
// Set blob content to an empty descriptor instead of nil as some registries that implement the OCI image manifest specification,
// such as AWS ECR, do not support pushing empty content.
// Ref: https://git.homegu.com/devcontainers/cli/issues/814
configDesc, err := pushBlob(ctx, configMediaType, []byte("{}"), src)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit dca3a27

Please sign in to comment.