Skip to content

Commit

Permalink
Changes for installing loki < 6.0 for OCP <= 4.14
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Honkalas <[email protected]>
  • Loading branch information
AdityaHonkalas committed Oct 10, 2024
1 parent 2c3b4ba commit 8bf158d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
10 changes: 0 additions & 10 deletions scripts/loki/loki-released-subscription.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions scripts/loki/loki-subscription-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: loki-subcription-template
objects:
- apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: "${{LOKI_CHANNEL}}"
name: loki-operator
source: "${{SOURCE}}"
sourceNamespace: openshift-marketplace
parameters:
- name: LOKI_CHANNEL
value: "stable-6.0"
- name: SOURCE
value: "redhat-operators"
10 changes: 0 additions & 10 deletions scripts/loki/loki-unreleased-subscription.yaml

This file was deleted.

16 changes: 14 additions & 2 deletions scripts/netobserv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,24 @@ deploy_lokistack() {
echo "====> Creating openshift-operators-redhat Namespace and OperatorGroup"
oc apply -f $SCRIPTS_DIR/loki/loki-operatorgroup.yaml

echo "====> Check the OCP release version:"
oc_minor_version=$(oc get clusterversion --no-headers | awk '{ print $2 }' | cut -d'.' -f2 -)

if [[ $(($oc_minor_version)) -ge 14 ]];
then
loki_channel="stable-6.0" ; echo "=====> Deploying the Loki with stable-6.0 channel..."
else
loki_channel="stable" ; echo "=====> Deploying the Loki with the stable channel..."
fi

echo "====> Creating netobserv-downstream-testing CatalogSource (if applicable) and Loki Operator Subscription"
if [[ $LOKI_OPERATOR == "Released" ]]; then
oc apply -f $SCRIPTS_DIR/loki/loki-released-subscription.yaml
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
oc apply -f /tmp/loki-released-subscription.yaml -n openshift-operators-redhat
elif [[ $LOKI_OPERATOR == "Unreleased" ]]; then
deploy_downstream_catalogsource
oc apply -f $SCRIPTS_DIR/loki/loki-unreleased-subscription.yaml
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
oc apply -f /tmp/loki-unreleased-subscription.yaml -n openshift-operators-redhat
else
echo "====> No Loki Operator config was found - using 'Released'"
echo "====> To set config, set LOKI_OPERATOR variable to either 'Released' or 'Unreleased'"
Expand Down

0 comments on commit 8bf158d

Please sign in to comment.