@@ -38,7 +38,7 @@ ENV OC_URL="https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${O
38
38
39
39
# Replace version with a version number to pin a specific version (eg: "4.7.8")
40
40
ARG ROSA_VERSION="latest"
41
- ENV ROSA_URL="https://mirror.openshift .com/pub /openshift-v4/x86_64/clients/ rosa/${ROSA_VERSION}"
41
+ ENV ROSA_URL="https://api.github .com/repos /openshift/ rosa/releases /${ROSA_VERSION}"
42
42
43
43
# Replace "/latest" with "/tags/{tag}" to pin to a specific version (eg: "/tags/v0.4.0")
44
44
ARG OSDCTL_VERSION="latest"
@@ -76,15 +76,16 @@ RUN tar --extract --gunzip --no-same-owner --directory /out oc --file *.tar.gz
76
76
RUN mkdir /rosa
77
77
WORKDIR /rosa
78
78
# Download the checksum
79
- RUN curl -sSLf ${ROSA_URL}/sha256sum.txt -o sha256sum.txt
80
- # Download the binary tarball
81
- RUN /bin/bash -c "curl -sSLf -O ${ROSA_URL}/$(awk -v asset=" rosa-linux" '$0~asset {print $2}' sha256sum.txt)"
82
- # Check the tarball and checksum match
79
+ RUN /bin/bash -c "curl -sSLf $(curl -sSLf ${ROSA_URL} -o - | jq -r '.assets[] | select(.name|test(" rosa-linux-amd64.sha256")) | .browser_download_url') -o sha256sum.txt"
80
+ # Download the binary
81
+ # NOTE: ROSA does a different type of sha256 setup (one per file) so the "$" below is necessary to select the binary filename
82
+ # correctly, and does not use a tarball
83
+ RUN /bin/bash -c "curl -sSLf -O $(curl -sSLf ${ROSA_URL} -o - | jq -r '.assets[] | select(.name|test(" rosa-linux-amd64$")) | .browser_download_url') "
84
+ # Check the binary and checksum match
83
85
RUN sha256sum --check --ignore-missing sha256sum.txt
84
- RUN tar --extract --gunzip --no-same-owner --directory /out rosa --file *.tar.gz
86
+ RUN mv rosa-linux-amd64 /out/ rosa
85
87
86
88
# Install osdctl
87
- # osdctl doesn't provide an sha256sum, and is not in a tarball
88
89
RUN mkdir /osdctl
89
90
WORKDIR /osdctl
90
91
# Download the checksum
0 commit comments