Skip to content

Commit cef6611

Browse files
Changes for installing loki < 6.0 with the stable channel on OCP < 4.17
Signed-off-by: Aditya Honkalas <[email protected]>
1 parent 2c3b4ba commit cef6611

File tree

3 files changed

+48
-20
lines changed

3 files changed

+48
-20
lines changed
+17-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
apiVersion: operators.coreos.com/v1alpha1
2-
kind: Subscription
1+
apiVersion: template.openshift.io/v1
2+
kind: Template
33
metadata:
4-
name: loki-operator
5-
namespace: openshift-operators-redhat
6-
spec:
7-
channel: stable-6.0
8-
name: loki-operator
9-
source: redhat-operators
10-
sourceNamespace: openshift-marketplace
4+
name: loki-released-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: "${{LokiChannel}}"
13+
name: loki-operator
14+
source: redhat-operators
15+
sourceNamespace: openshift-marketplace
16+
parameters:
17+
- name: LokiChannel
18+
value: "stable-6.0"
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
apiVersion: operators.coreos.com/v1alpha1
2-
kind: Subscription
1+
apiVersion: template.openshift.io/v1
2+
kind: Template
33
metadata:
4-
name: loki-operator
5-
namespace: openshift-operators-redhat
6-
spec:
7-
channel: stable-6.0
8-
name: loki-operator
9-
source: netobserv-downstream-testing
10-
sourceNamespace: openshift-marketplace
4+
name: loki-unreleased-subscription-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: "${{LokiChannel}}"
13+
name: loki-operator
14+
source: netobserv-downstream-testing
15+
sourceNamespace: openshift-marketplace
16+
parameters:
17+
- name: LokiChannel
18+
value: "stable-6.0"

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 17 ]];
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-released-subscription.yaml -p LokiChannel=$loki_channel -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-unreleased-subscription.yaml -p LokiChannel=$loki_channel -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)