Skip to content

Commit

Permalink
chore: Fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Denilson Nastacio <[email protected]>
  • Loading branch information
nastacio committed Feb 6, 2024
1 parent 25cdadd commit e247c93
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ spec:
value: {{.Values.metadata.ibm_cert_manager_operator_group}}
- name: IBM_CERT_MANAGER_CHANNEL
value: {{.Values.metadata.ibm_cert_manager_channel}}
- name: IBM_LICENSE_MANAGER_NAMESPACE
value: {{.Values.metadata.ibm_license_manager_namespace}}
- name: IBM_LICENSE_MANAGER_OPERATOR_GROUP
value: {{.Values.metadata.ibm_license_manager_operator_group}}
- name: IBM_LICENSE_MANAGER_CHANNEL
value: {{.Values.metadata.ibm_license_manager_channel}}
command:
- /bin/sh
- -c
Expand Down Expand Up @@ -90,13 +96,74 @@ spec:
-A
fi
else
echo "ERROR: Unable to ascertain status of cert managers in the cluster."
echo "ERROR: Unable to get status of cert managers in the cluster."
fi
if [ "${result}" -eq 1 ] ; then
echo "ERROR: Unable to locate a running IBM Cert Manager and to install one afterwards."
fi
ibm_license_manager_count=$(oc get Subscription.operators.coreos.com \
-l operators.coreos.com/ibm-cert-manager-operator.ibm-cert-manager \
-A \
-o name | wc -l || result=1)
if [ "${result}" == 0 ]; then
if [ "${ibm_license_manager_count}" == "0" ]; then
echo "INFO: Installing IBM Cert Manager."
cat << EOF | oc apply -f -
---
kind: Namespace
apiVersion: v1
metadata:
name: ${IBM_LICENSE_MANAGER_NAMESPACE:?}
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: ibm-licensing-operator-app
namespace: ${IBM_LICENSE_MANAGER_NAMESPACE:?}
spec:
targetNamespaces:
- ${IBM_LICENSE_MANAGER_NAMESPACE:?}
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: ibm-licensing-operator-app
namespace: ${IBM_LICENSE_MANAGER_NAMESPACE:?}
spec:
channel: v4.2
installPlanApproval: Automatic
name: ibm-licensing-operator-app
source: ibm-licensing-catalog
sourceNamespace: openshift-marketplace
EOF
while [ $SECONDS -lt 300 ]; do
oc wait Subscription.operators.coreos.com ibm-licensing-operator-app \
-n ${IBM_LICENSE_MANAGER_NAMESPACE:?} \
--for=condition=CatalogSourcesUnhealthy=False \
&& oc wait Subscription.operators.coreos.com ibm-licensing-operator-app \
-n ${IBM_LICENSE_MANAGER_NAMESPACE:?} \
--for=jsonpath='{.status.state}'="AtLatestKnown" \
&& echo "INFO: Successfully installed IBM License Manager." \
&& result=0 \
&& break \
|| result=1
echo "INFO: Waiting for the subscription to be ready."
sleep 20
done
else
echo "INFO: IBM License Manager already installed."
oc get Subscription.operators.coreos.com \
-l operators.coreos.com/ibm-licensing-operator-app.ibm-licensing \
-A
fi
else
echo "ERROR: Unable to get status of cert managers in the cluster."
fi
exit "${result}"
restartPolicy: Never
Expand Down
3 changes: 3 additions & 0 deletions config/cloudpaks/cp-shared/operators/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
ibm_cert_manager_channel: v4.2
ibm_cert_manager_namespace: ibm-cert-manager
ibm_cert_manager_operator_group: ibm-cert-manager-operator-group
ibm_license_manager_channel: v4.2
ibm_license_manager_namespace: ibm-licensing
ibm_license_manager_operator_group: ibm-licensing-operator-app
redhat_cert_manager_namespace: cert-manager-operator
redhat_cert_manager_operator_group: cert-manager-operator-group
serviceaccount:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ spec:
updateStrategy:
registryPoll:
interval: 45m
priority: 100
priority: 100
---
# IBM Business Teams Service version 3.32.0
apiVersion: operators.coreos.com/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/managed-by: ibm-dba
app.kubernetes.io/name: ibm-dba
name: icp4adeploy
namespace: {{.Values.argocd_app_namespace: }}
namespace: {{.Values.argocd_app_namespace}}
spec:
appVersion: 23.0.2
datasource_configuration:
Expand Down

0 comments on commit e247c93

Please sign in to comment.