-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #431 from stuggi/revert_revert_certmanager
Revert "Revert "Add certmanager target to install via olm""
- Loading branch information
Showing
2 changed files
with
119 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2023 Red Hat Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
set -ex | ||
|
||
if [ -z "${OPERATOR_DIR}" ]; then | ||
echo "Please set OPERATOR_DIR"; exit 1 | ||
fi | ||
|
||
if [ -z "${OPERATOR_NAMESPACE}" ]; then | ||
echo "Please set OPERATOR_NAMESPACE"; exit 1 | ||
fi | ||
|
||
if [ -z "${OCP_RELEASE}" ]; then | ||
echo "Please set OCP_RELEASE"; exit 1 | ||
fi | ||
|
||
if [ -z "${CHANNEL}" ]; then | ||
echo "Please set CHANNEL"; exit 1 | ||
fi | ||
|
||
if [ ! -d ${OPERATOR_DIR} ]; then | ||
mkdir -p ${OPERATOR_DIR} | ||
fi | ||
|
||
echo OCP_RELEASE ${OCP_RELEASE} | ||
echo OPERATOR_DIR ${OPERATOR_DIR} | ||
echo OPERATOR_NAMESPACE ${OPERATOR_NAMESPACE} | ||
echo CHANNEL ${CHANNEL} | ||
|
||
if [ "$OCP_RELEASE" = "4.10" ]; then | ||
cat > ${OPERATOR_DIR}/operatorgroup.yaml <<EOF_CAT | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
annotations: | ||
olm.providedAPIs: CertManager.v1alpha1.config.openshift.io,CertManager.v1alpha1.operator.openshift.io,Certificate.v1.cert-manager.io,CertificateRequest.v1.cert-manager.io,Challenge.v1.acme.cert-manager.io,ClusterIssuer.v1.cert-manager.io,Issuer.v1.cert-manager.io,Order.v1.acme.cert-manager.io | ||
generateName: cert-manager-operator- | ||
name: openshift-cert-manager-operator-nd6mt | ||
namespace: ${OPERATOR_NAMESPACE} | ||
spec: {} | ||
EOF_CAT | ||
else | ||
cat > ${OPERATOR_DIR}/operatorgroup.yaml <<EOF_CAT | ||
apiVersion: operators.coreos.com/v1 | ||
kind: OperatorGroup | ||
metadata: | ||
annotations: | ||
olm.providedAPIs: CertManager.v1alpha1.operator.openshift.io,Certificate.v1.cert-manager.io,CertificateRequest.v1.cert-manager.io,Challenge.v1.acme.cert-manager.io,ClusterIssuer.v1.cert-manager.io,Issuer.v1.cert-manager.io,Order.v1.acme.cert-manager.io | ||
generateName: cert-manager-operator- | ||
name: cert-manager-operator-bccwx | ||
namespace: ${OPERATOR_NAMESPACE} | ||
spec: | ||
targetNamespaces: | ||
- ${OPERATOR_NAMESPACE} | ||
upgradeStrategy: Default | ||
EOF_CAT | ||
fi | ||
|
||
cat > ${OPERATOR_DIR}/subscription.yaml <<EOF_CAT | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
labels: | ||
operators.coreos.com/openshift-cert-manager-operator.${OPERATOR_NAMESPACE}: "" | ||
name: openshift-cert-manager-operator | ||
namespace: ${OPERATOR_NAMESPACE} | ||
spec: | ||
channel: ${CHANNEL} | ||
installPlanApproval: Automatic | ||
name: openshift-cert-manager-operator | ||
source: redhat-operators | ||
sourceNamespace: openshift-marketplace | ||
EOF_CAT |