Skip to content

Commit

Permalink
Updated CSV metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
sabre1041 committed May 2, 2021
1 parent f969f1a commit 18e8121
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ jobs:
push: true
tags: "quay.io/${{ env.QUAY_REGISTRY }}:latest,quay.io/${{ env.QUAY_REGISTRY }}:${{ env.OPERATOR_IMAGE_TAG }}"

- name: Set Operator Digests
- name: Update CSV
env:
QUAY_REGISTRY: "${{ env.QUAY_REGISTRY }}"
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}"
OPERATOR_IMAGE_TAG: "${{ env.OPERATOR_IMAGE_TAG }}"
run: ./hack/attach_image_digests.sh
run: ./hack/update_csv.sh

- name: Verify bundle after digests
- name: Verify bundle after csv update
shell: bash
run: operator-sdk bundle validate ./bundle --select-optional name=operatorhub

Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:
OPERATOR_IMAGE_TAG: "v${{ env.VERSION }}"
run: |
make bundle IMG=quay.io/${QUAY_REGISTRY}:v${VERSION} VERSION=${VERSION} DEFAULT_CHANNEL=alpha
./hack/attach_image_digests.sh
./hack/update_csv.sh
sed 's/bundle\///g' bundle.Dockerfile > bundle/Dockerfile
sed -i '/replaces: '"$(basename $GITHUB_REPOSITORY)"'/d' ./bundle/manifests/$(basename $GITHUB_REPOSITORY).clusterserviceversion.yaml
mkdir -p ./tmp/community-operators/community-operators/$(basename $GITHUB_REPOSITORY)/${VERSION}
Expand Down
5 changes: 5 additions & 0 deletions hack/attach_image_digests.sh → hack/update_csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ if [ ! -f "${CSV_FILE}" ]; then
exit 1
fi

CREATED_TIME=`date +"%FT%H:%M:%SZ"`
OPERATOR_IMAGE_DIGEST=$(skopeo inspect docker://quay.io/${QUAY_REGISTRY}:${OPERATOR_IMAGE_TAG} | jq -r ".Digest")
OPERATOR_IMAGE="quay.io/${QUAY_REGISTRY}@${OPERATOR_IMAGE_DIGEST}"
KUBE_RBAC_PROXY_IMAGE_DIGEST=$(skopeo inspect docker://$(yq r bundle/manifests/${REPOSITORY_NAME}.clusterserviceversion.yaml 'spec.install.spec.deployments[0].spec.template.spec.containers[0].image') | jq -r ".Digest")
KUBE_RBAC_PROXY_IMAGE="$(yq r bundle/manifests/${REPOSITORY_NAME}.clusterserviceversion.yaml 'spec.install.spec.deployments[0].spec.template.spec.containers[0].image' | cut -d':' -f1)@${KUBE_RBAC_PROXY_IMAGE_DIGEST}"

yq write --inplace "${CSV_FILE}" 'metadata.annotations.containerImage' ${OPERATOR_IMAGE}

yq write --inplace "${CSV_FILE}" 'metadata.annotations.createdAt' ${CREATED_TIME}

cat << EOF | yq write --inplace --script - "${CSV_FILE}"
- command: update
path: spec.relatedImages[+]
Expand Down

0 comments on commit 18e8121

Please sign in to comment.