Commit cef6611 1 parent 2c3b4ba commit cef6611 Copy full SHA for cef6611
File tree 3 files changed +48
-20
lines changed
3 files changed +48
-20
lines changed Original file line number Diff line number Diff line change 1
- apiVersion : operators.coreos.com/v1alpha1
2
- kind : Subscription
1
+ apiVersion : template.openshift.io/v1
2
+ kind : Template
3
3
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 number Diff line number Diff line change 1
- apiVersion : operators.coreos.com/v1alpha1
2
- kind : Subscription
1
+ apiVersion : template.openshift.io/v1
2
+ kind : Template
3
3
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"
Original file line number Diff line number Diff line change @@ -105,12 +105,24 @@ deploy_lokistack() {
105
105
echo " ====> Creating openshift-operators-redhat Namespace and OperatorGroup"
106
106
oc apply -f $SCRIPTS_DIR /loki/loki-operatorgroup.yaml
107
107
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
+
108
118
echo " ====> Creating netobserv-downstream-testing CatalogSource (if applicable) and Loki Operator Subscription"
109
119
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
111
122
elif [[ $LOKI_OPERATOR == " Unreleased" ]]; then
112
123
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
114
126
else
115
127
echo " ====> No Loki Operator config was found - using 'Released'"
116
128
echo " ====> To set config, set LOKI_OPERATOR variable to either 'Released' or 'Unreleased'"
You can’t perform that action at this time.
0 commit comments