Skip to content

Commit

Permalink
Ensure that the empty blob exists
Browse files Browse the repository at this point in the history
Technically, we could first check that it exists with oras blob fetch,
and then only push it if it doesn't exist - but it is so small and oras
checks anyways before pushing. Just do it in one command for
simplicity's sake.
  • Loading branch information
ralphbean committed Jul 12, 2024
1 parent 9b1baf0 commit b7fa176
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions task/oci-copy/0.1/oci-copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ spec:
}
EOL
echo "Ensuring that the empty blob exists, for the image manifest config."
echo -n "{}" | oras blob push \
--registry-config auth.json \
${REPO}@sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a \
--media-type application/vnd.oci.empty.v1+json --size 2 -
for varfile in /var/workdir/vars/*; do
echo "Reading $varfile"
source $varfile
Expand Down

0 comments on commit b7fa176

Please sign in to comment.