-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRVCOM-3319: Generate CSV with Konflux images (serving, eventing, operator) #2827
Conversation
Skipping CI for Draft Pull Request. |
hack/lib/images.bash
Outdated
function latest_konflux_image_sha() { | ||
input=${1:?"Provide image"} | ||
|
||
image_without_tag=${input%:*} # Remove tag, if any | ||
image_without_tag=${image_without_tag%@*} # Remove sha, if any | ||
|
||
# TODO uncomment, exit with error | ||
# digest=$(docker manifest inspect "${image_without_tag}:latest" -v | jq '.Descriptor.digest') | ||
digest='' | ||
if [ "${digest}" = "" ]; then | ||
# exit 1 | ||
echo "${image_without_tag}:latest" | ||
return | ||
fi | ||
|
||
echo "${image_without_tag}@${digest}" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix TODO
once we are on 1.35 and we have serving, eventing, and SO built with Konflux
if ! grep "${bundle}" "${rootdir}/${index_dorkerfile_path}"; then | ||
logger.error "Bundle ${bundle} not found in Dockerfile." | ||
return 1 | ||
fi | ||
sed -i "s_\(.*\)\(${bundle}\)\(.*\)_\1image-registry.openshift-image-registry.svc:5000/$OLM_NAMESPACE/serverless-bundle:latest\3_" "${rootdir}/${index_dorkerfile_path}" | ||
sed -ri "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/${OLM_NAMESPACE}/serverless-bundle:latest\5#" "${rootdir}/${index_dorkerfile_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with:
$ bundle="quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-bundle"
$ sed -r "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest\5#" olm-catalog/serverless-operator/index/Dockerfile
FROM registry.ci.openshift.org/origin/4.15:operator-registry AS opm
FROM registry.access.redhat.com/ubi9/ubi-minimal as builder
COPY --from=opm /bin/opm /bin/opm
COPY olm-catalog/serverless-operator/index/configs /configs
RUN /bin/opm init serverless-operator --default-channel=stable --output yaml >> /configs/index.yaml
RUN /bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle >> /configs/index.yaml || \
/bin/opm render --skip-tls-verify -o yaml \
quay.io/openshift-knative/serverless-bundle:release-1.32.0 \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest >> /configs/index.yaml
FROM registry.ci.openshift.org/origin/4.15:operator-registry
COPY --from=builder /configs /configs
LABEL operators.operatorframework.io.index.configs.v1=/configs
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is for matching:
(.*)
match starting spaces and anything else until the next match(${bundle})
match the bundle image without tag or sha(:[a-z0-9]*)?
optionally match tag(@sha[0-9]+:[a-z0-9]+)?
optionally match sha(.*)
match the rest
Replace:
\1
Use everything matched by 1image-registry.openshift-image-registry.svc:5000/${OLM_NAMESPACE}/serverless-bundle:latest
replace the image\5
use everything matched by 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
752f0f2
to
38c6293
Compare
38c6293
to
02623e7
Compare
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Tested with: ``` $ bundle="quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-release-134/serverless-bundle" $ sed -r "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest\5#" olm-catalog/serverless-operator/index/Dockerfile FROM registry.ci.openshift.org/origin/4.15:operator-registry AS opm FROM registry.access.redhat.com/ubi9/ubi-minimal as builder COPY --from=opm /bin/opm /bin/opm COPY olm-catalog/serverless-operator/index/configs /configs RUN /bin/opm init serverless-operator --default-channel=stable --output yaml >> /configs/index.yaml RUN /bin/opm render --skip-tls-verify -o yaml \ quay.io/openshift-knative/serverless-bundle:release-1.32.0 \ registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \ registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle >> /configs/index.yaml || \ /bin/opm render --skip-tls-verify -o yaml \ quay.io/openshift-knative/serverless-bundle:release-1.32.0 \ registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \ image-registry.openshift-image-registry.svc:5000/<namespace>/serverless-bundle:latest >> /configs/index.yaml FROM registry.ci.openshift.org/origin/4.15:operator-registry COPY --from=builder /configs /configs LABEL operators.operatorframework.io.index.configs.v1=/configs ENTRYPOINT ["/bin/opm"] CMD ["serve", "/configs"] ``` Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
02623e7
to
bd3e646
Compare
Signed-off-by: Pierangelo Di Pilato <[email protected]>
Signed-off-by: Pierangelo Di Pilato <[email protected]>
/test 416-operator-e2e-aws-416 |
Signed-off-by: Pierangelo Di Pilato <[email protected]>
1b31329
to
c52aab1
Compare
/test 416-operator-e2e-aws-416 |
1 similar comment
/test 416-operator-e2e-aws-416 |
skopeo because, Podman doesn't work, Docker needs DinD in CI. Signed-off-by: Pierangelo Di Pilato <[email protected]>
ba3bacf
to
56739e3
Compare
341e9ef
to
db10a4b
Compare
@pierDipi: This pull request references SRVCOM-3319 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/test 416-upstream-e2e-kafka-aws-416 |
/test 416-test-upgrade-aws-416 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ k -n knative-eventing get po eventing-controller-5dcb8787-4d4jb -ojsonpath='{.spec.containers[*].image}'
quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-135/kn-eventing-controller@sha256:221b032b42a451896b2f73530b327934c8d662a67a6ea3b1e1e8bcfecd1a666f registry.ci.openshift.org/origin/4.15:kube-rbac-proxy
/lgtm
export GOPATH="$PATH:$go_bin" | ||
digest=$(skopeo inspect "docker://${image_without_tag}:latest" | jq -r '.Digest') | ||
if [ "${digest}" = "" ]; then | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: print the reason for the exit (can be done as a follow up)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: creydr, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
2 similar comments
@pierDipi: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
It doesn't seem related |
No description provided.