Skip to content

Commit

Permalink
Changes for installing loki < 6.0 with the stable channel on OCP < 4.17
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Honkalas <[email protected]>
  • Loading branch information
AdityaHonkalas committed Oct 9, 2024
1 parent 2c3b4ba commit cef6611
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 20 deletions.
26 changes: 17 additions & 9 deletions scripts/loki/loki-released-subscription.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: stable-6.0
name: loki-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
name: loki-released-subcription-template
objects:
- apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: "${{LokiChannel}}"
name: loki-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
parameters:
- name: LokiChannel
value: "stable-6.0"
26 changes: 17 additions & 9 deletions scripts/loki/loki-unreleased-subscription.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: stable-6.0
name: loki-operator
source: netobserv-downstream-testing
sourceNamespace: openshift-marketplace
name: loki-unreleased-subscription-template
objects:
- apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: loki-operator
namespace: openshift-operators-redhat
spec:
channel: "${{LokiChannel}}"
name: loki-operator
source: netobserv-downstream-testing
sourceNamespace: openshift-marketplace
parameters:
- name: LokiChannel
value: "stable-6.0"
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 17 ]];
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-released-subscription.yaml -p LokiChannel=$loki_channel -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-unreleased-subscription.yaml -p LokiChannel=$loki_channel -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 cef6611

Please sign in to comment.