Skip to content

Commit

Permalink
MULTIARCH-3440: update the code to use go-containerregistry for all a…
Browse files Browse the repository at this point in the history
…rches and add arm64

Signed-off-by: Paul Bastide <pbastide@redhat.com>
  • Loading branch information
prb112 committed May 24, 2023
1 parent 0bec359 commit ac6a24c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ builds:
- amd64
- ppc64le
- s390x
- arm64
env:
- CGO_ENABLED=1
flags:
Expand Down
47 changes: 15 additions & 32 deletions test/e2e/lib/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,47 +43,30 @@ function cleanup_conn() {

# install_deps will install crane and registry2 in go bin dir
function install_deps() {
pushd ${DATA_TMP}
GOFLAGS=-mod=mod go install github.com/google/go-containerregistry/cmd/crane@latest

if [ "$(arch)" == "x86_64" ]
then
pushd ${DATA_TMP}
GOFLAGS=-mod=mod go install github.com/google/go-containerregistry/cmd/crane@latest
popd
crane export registry:2 registry2.tar
tar xvf registry2.tar bin/registry
mv bin/registry $GOBIN
crane export quay.io/operator-framework/opm@sha256:d31c6ea5c50be93d6eb94d2b508f0208e84a308c011c6454ebf291d48b37df19 opm.tar
tar xvf opm.tar bin/opm
mv bin/opm $GOBIN
rm -f registry2.tar opm.tar
wget -O $GOBIN/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x $GOBIN/jq
else
pushd ${DATA_TMP}
# Creates a temp directory
mkdir -p test/e2e/operator-test.deps
cd test/e2e/operator-test.deps
rm -f opm.tar

# Note: this resource is not multiarch enabled, use the package repo which is.
wget -O $GOBIN/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x $GOBIN/jq
else
curl -o $GOBIN/opm -L https://github.com/operator-framework/operator-registry/releases/download/v1.26.5/linux-$(arch)-opm
chmod +x $GOBIN/opm

# Serves a local registry
# When PR https://github.com/google/go-containerregistry/pull/1680
# is in a release the following few lines won't be necessary.
git clone https://github.com/google/go-containerregistry.git
cd go-containerregistry
git checkout $(git describe --tags) # latest tag
go build ./cmd/crane
mv crane $GOBIN/

crane export $(arch)/registry:2 registry2.tar
tar xvf registry2.tar bin/registry
cp bin/registry ../
mv bin/registry $GOBIN

cd ..
rm -rf go-containerregistry/
popd
fi

crane export $(arch)/registry:2 registry2.tar
tar xvf registry2.tar bin/registry
cp bin/registry ../
mv bin/registry $GOBIN
rm -f registry2.tar
popd
}

# setup_reg will configure and start registry2 processes
Expand Down

0 comments on commit ac6a24c

Please sign in to comment.