forked from gatekeeper/gatekeeper-operator
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Establish bundle Dockerfile for Konflux
Signed-off-by: Dale Haiducek <[email protected]>
- Loading branch information
1 parent
0eba35e
commit 00dc7b1
Showing
5 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.17 as builder | ||
|
||
WORKDIR /gatekeeper-operator | ||
COPY . . | ||
RUN /gatekeeper-operator/build/konflux-patch.sh | ||
|
||
FROM scratch | ||
|
||
# Copy files to locations specified by labels. | ||
COPY --from=builder /gatekeeper-operator/bundle/manifests /manifests/ | ||
COPY --from=builder /gatekeeper-operator/bundle/metadata /metadata/ | ||
|
||
# Core bundle annotations. | ||
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable | ||
LABEL operators.operatorframework.io.bundle.channels.v1="stable,3.17" | ||
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||
LABEL operators.operatorframework.io.bundle.package.v1=gatekeeper-operator | ||
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1 | ||
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 | ||
# Red Hat annotations. | ||
LABEL com.redhat.component=gatekeeper-operator-bundle-container | ||
LABEL com.redhat.delivery.backport=false | ||
LABEL com.redhat.delivery.operator.bundle=true | ||
LABEL com.redhat.openshift.versions=v4.12 | ||
# Bundle metadata | ||
LABEL name=gatekeeper/gatekeeper-operator-bundle | ||
LABEL description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper." | ||
LABEL io.k8s.description="The Gatekeeper Operator installs and configures Open Policy Agent Gatekeeper." | ||
LABEL summary="Red Hat Gatekeeper Operator" | ||
LABEL version=v3.17.0 | ||
LABEL release="" | ||
LABEL distribution-scope=public | ||
LABEL maintainer="[email protected]" | ||
LABEL url=https://github.com/stolostron/gatekeeper-operator | ||
LABEL vendor="Red Hat, Inc." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
# Gatekeeper Operator image | ||
operator_img="registry.redhat.io/gatekeeper/gatekeeper-rhel9-operator@sha256:6e386be134d928bdb03b702e399c97e7aedecacaa3d0813183a8c5ecf13c7bc2" | ||
# Gatekeeper image | ||
gatekeeper_img="registry.redhat.io/gatekeeper/gatekeeper-rhel9@sha256:3095f68c12c5dc3b00ce84e1c37d516d96cbcb06d42eaef5372358786956bd62" | ||
|
||
build_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
csv_file=${build_dir}/../bundle/manifests/gatekeeper-operator.clusterserviceversion.yaml | ||
|
||
csv_patch=$(printf '[{ | ||
"op": "replace", | ||
"path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/env/0/value", | ||
"value": "%s", | ||
},{ | ||
"op": "replace", | ||
"path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/image", | ||
"value": "%s", | ||
},{ | ||
"op": "replace", | ||
"path": "/spec/relatedImages/0/image", | ||
"value": "%s", | ||
}]' ${gatekeeper_img} ${operator_img} ${gatekeeper_img}) | ||
|
||
kubectl patch --local=true -f ${csv_file} --type=json --patch="${csv_patch}" --output=yaml >${csv_file}.bk | ||
mv ${csv_file}.bk ${csv_file} |