Skip to content

Commit f339138

Browse files
authored
CLOUDP-154873: Fix Openshift image certification (#867)
* fix action to certify container images
1 parent ffb2f08 commit f339138

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

.github/actions/certify-openshift-images/Dockerfile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
FROM docker:23.0-rc-cli
1+
FROM registry.access.redhat.com/ubi8/ubi:latest
22

3-
RUN apk update && \
4-
apk add --no-cache curl jq
3+
RUN yum install -y \
4+
bzip2 \
5+
gzip \
6+
tar \
7+
iptables \
8+
yum-utils \
9+
jq
10+
11+
RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
12+
yum list docker-ce --showduplicates | sort -r && \
13+
yum install -y \
14+
docker-ce \
15+
docker-ce-cli \
16+
containerd.io
17+
18+
RUN yum clean all
519

620
RUN curl -LO https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/1.4.3/preflight-linux-amd64 && \
721
chmod +x ./preflight-linux-amd64 && \

.github/actions/certify-openshift-images/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ inputs:
1616
rhcc_project:
1717
description: The Redhat certification central project id
1818
required: true
19+
submit:
20+
description: Submit result to RedHat Connect
21+
required: false
22+
default: "false"
1923
runs:
2024
using: 'docker'
2125
image: 'Dockerfile'
@@ -25,3 +29,4 @@ runs:
2529
QUAY_PASSWORD: ${{ inputs.quay_password }}
2630
RHCC_TOKEN: ${{ inputs.rhcc_token }}
2731
RHCC_PROJECT: ${{ inputs.rhcc_project }}
32+
SUBMIT: ${{ inputs.submit }}

.github/actions/certify-openshift-images/entrypoint.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22

33
set -eou pipefail
44

5-
docker login -u unused -p "${QUAY_PASSWORD}" quay.io
5+
docker login -u mongodb+mongodb_atlas_kubernetes -p "${QUAY_PASSWORD}" quay.io
66

77
DIGESTS=$(docker manifest inspect "${REPOSITORY}:${VERSION}" | jq -r .manifests[].digest)
88

99
for DIGEST in $DIGESTS; do
1010
echo "Checking image $DIGEST"
1111
# Do the preflight check first
12-
preflight check container "${DIGEST}" --docker-config="${HOME}/.docker/config.json"
12+
preflight check container "${REPOSITORY}:${VERSION}@${DIGEST}" --artifacts "${DIGEST}" --docker-config="${HOME}/.docker/config.json"
1313

14-
# Send results to RedHat if preflight finished without errors
15-
preflight check container "${DIGEST}" \
16-
--submit \
17-
--pyxis-api-token="${RHCC_TOKEN}" \
18-
--certification-project-id="${RHCC_PROJECT}" \
19-
--docker-config="${HOME}/.docker/config.json"
14+
if [ "$SUBMIT" = "true" ]; then
15+
rm -rf "${DIGEST}"
16+
echo "Submitting result to RedHat Connect"
17+
# Send results to RedHat if preflight finished wthout errors
18+
preflight check container "${REPOSITORY}@${DIGEST}" \
19+
--artifacts "${DIGEST}" \
20+
--pyxis-api-token="${RHCC_TOKEN}" \
21+
--certification-project-id="${RHCC_PROJECT}" \
22+
--docker-config="${HOME}/.docker/config.json" \
23+
--submit
24+
fi
2025
done

.github/workflows/release-openshift.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
quay_password: ${{ secrets.QUAY_PASSWORD }}
6363
rhcc_token: ${{ secrets.RH_CERTIFICATION_PYXIS_API_TOKEN }}
6464
rhcc_project: ${{ secrets.RH_CERTIFICATION_OSPID }}
65+
submit: "true"
6566
- name: Configure certified release
6667
if: ${{ matrix.certified }}
6768
env:

0 commit comments

Comments
 (0)