Skip to content

Commit 74c3e9f

Browse files
authored
Adding related images field (#850)
### Objective: To add related images field as is needed for the red hat certification. ### Additional information: We need a post script to get the digest form once images has been pushed. ### Documentation: * [verify-pinned-digest](https://github.com/redhat-openshift-ecosystem/certification-releases/blob/main/4.9/ga/troubleshooting.md#verify-pinned-digest) * This step also checks for the existence of a `spec.relatedImages` section in your Cluster Service Version (CSV).
1 parent 83714fa commit 74c3e9f

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

operator/bundle/manifests/minio-directpv-operator-rhmp.clusterserviceversion.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,8 @@ spec:
332332
name: DirectPV
333333
url: https://min.io/directpv
334334
version: 4.0.7
335+
relatedImages:
336+
- image: gcr.io/kubebuilder/kube-rbac-proxy@sha256:d4883d7c622683b3319b5e6b3a7edfbf2594c18060131a8bf64504805f875522
337+
name: kube-rbac-proxy
338+
- image: quay.io/minio/directpv-operator@sha256:dadf28674b15c256bc5dec3e99d90f811ea3ac1fdee17c51e2928063a5341e5e
339+
name: manager

release-operator.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,43 @@ function make_release() {
150150
cd -
151151
}
152152

153+
### subsequent_steps() objective:
154+
#
155+
# To add additional things once images has been pushed in make_release()
156+
#
157+
### Reasoning:
158+
#
159+
# We can't add these additional things until images are pushed.
160+
# This is why we need this function, similar to what we are doing at
161+
# Operator repo: https://github.com/minio/operator/blob/master/olm-post-script.sh
162+
#
163+
function subsequent_steps() {
164+
"${PODMAN}" pull quay.io/minio/directpv-operator:"${BUILD_VERSION}"
165+
"${PODMAN}" pull gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
166+
PROXY_DIGEST=$("${PODMAN}" image list gcr.io/kubebuilder/kube-rbac-proxy --digests | grep sha | awk -F ' ' '{print $3}')
167+
OPERATOR_DIGEST=$("${PODMAN}" image list quay.io/minio/directpv-operator --digests | grep sha | awk -F ' ' '{print $3}')
168+
169+
### relatedImages: Field needed by RedHat Certification.
170+
# kind: ClusterServiceVersion
171+
# spec:
172+
# relatedImages:
173+
# - image: gcr.io/kubebuilder/kube-rbac-proxy@sha256:<digest>
174+
# name: kube-rbac-proxy
175+
# - image: quay.io/minio/directpv-operator@sha256:<digest>
176+
# name: manager
177+
#
178+
# Add relatedImages to CSV
179+
yq -i ".spec.relatedImages |= []" ./operator/bundle/manifests/minio-directpv-operator-rhmp.clusterserviceversion.yaml
180+
# Add kube-rbac-proxy image
181+
yq -i ".spec.relatedImages[0] = {\"image\": \"gcr.io/kubebuilder/kube-rbac-proxy@${PROXY_DIGEST}\", \"name\": \"kube-rbac-proxy\"}" ./operator/bundle/manifests/minio-directpv-operator-rhmp.clusterserviceversion.yaml
182+
# Add manager image
183+
yq -i ".spec.relatedImages[1] = {\"image\": \"quay.io/minio/directpv-operator@${OPERATOR_DIGEST}\", \"name\": \"manager\"}" ./operator/bundle/manifests/minio-directpv-operator-rhmp.clusterserviceversion.yaml
184+
}
185+
153186
function main() {
154187
update_charts
155188
make_release
189+
subsequent_steps
156190
}
157191

158192
init "$@"

0 commit comments

Comments
 (0)