Skip to content

Commit 8bf158d

Browse files
Changes for installing loki < 6.0 for OCP <= 4.14
Signed-off-by: Aditya Honkalas <[email protected]>
1 parent 2c3b4ba commit 8bf158d

4 files changed

+34
-22
lines changed

scripts/loki/loki-released-subscription.yaml

-10
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: template.openshift.io/v1
2+
kind: Template
3+
metadata:
4+
name: loki-subcription-template
5+
objects:
6+
- apiVersion: operators.coreos.com/v1alpha1
7+
kind: Subscription
8+
metadata:
9+
name: loki-operator
10+
namespace: openshift-operators-redhat
11+
spec:
12+
channel: "${{LOKI_CHANNEL}}"
13+
name: loki-operator
14+
source: "${{SOURCE}}"
15+
sourceNamespace: openshift-marketplace
16+
parameters:
17+
- name: LOKI_CHANNEL
18+
value: "stable-6.0"
19+
- name: SOURCE
20+
value: "redhat-operators"

scripts/loki/loki-unreleased-subscription.yaml

-10
This file was deleted.

scripts/netobserv.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,24 @@ deploy_lokistack() {
105105
echo "====> Creating openshift-operators-redhat Namespace and OperatorGroup"
106106
oc apply -f $SCRIPTS_DIR/loki/loki-operatorgroup.yaml
107107

108+
echo "====> Check the OCP release version:"
109+
oc_minor_version=$(oc get clusterversion --no-headers | awk '{ print $2 }' | cut -d'.' -f2 -)
110+
111+
if [[ $(($oc_minor_version)) -ge 14 ]];
112+
then
113+
loki_channel="stable-6.0" ; echo "=====> Deploying the Loki with stable-6.0 channel..."
114+
else
115+
loki_channel="stable" ; echo "=====> Deploying the Loki with the stable channel..."
116+
fi
117+
108118
echo "====> Creating netobserv-downstream-testing CatalogSource (if applicable) and Loki Operator Subscription"
109119
if [[ $LOKI_OPERATOR == "Released" ]]; then
110-
oc apply -f $SCRIPTS_DIR/loki/loki-released-subscription.yaml
120+
oc process --ignore-unknown-parameters=true -f $SCRIPTS_DIR/loki/loki-subscription-template.yaml -p LOKI_CHANNEL=$loki_channel -p SOURCE=redhat-operators -o yaml > /tmp/loki-released-subscription.yaml
121+
oc apply -f /tmp/loki-released-subscription.yaml -n openshift-operators-redhat
111122
elif [[ $LOKI_OPERATOR == "Unreleased" ]]; then
112123
deploy_downstream_catalogsource
113-
oc apply -f $SCRIPTS_DIR/loki/loki-unreleased-subscription.yaml
124+
oc process --ignore-unknown-parameters=true -f $SCRIPTS_DIR/loki/loki-subscription-template.yaml -p LOKI_CHANNEL=$loki_channel -p SOURCE=netobserv-downstream-testing -o yaml > /tmp/loki-unreleased-subscription.yaml
125+
oc apply -f /tmp/loki-unreleased-subscription.yaml -n openshift-operators-redhat
114126
else
115127
echo "====> No Loki Operator config was found - using 'Released'"
116128
echo "====> To set config, set LOKI_OPERATOR variable to either 'Released' or 'Unreleased'"

0 commit comments

Comments
 (0)