Files
odo/scripts/configure-installer-tests-cluster.sh
Priti Kumari 9dba98a9e2 Enable olm and Run operatorhub tests on kubernetes cluster (#4754)
* Running operatorhub tests on kubernetes cluster

* Fixing script path

* Align spec field in service binding subscription yaml

* Adding debugging steps for Finding ImagePullBackOff Reason

* Adding mongodb operator and modifying test accordingly to resolve https://github.com/openshift/odo/issues/4651#issuecomment-851269315

* Fixing command typo for kubernetes

* Fixing regex issue

* Fixing mongodb subscription yaml format

* Injecting docker account secrets into kubernetes cluster for etcd services

* remove setup-kube-operators file

* Separate setup for kubernetes operator

* Adding operators common for both ocp and minikube

* sync function for ocp and minikube

* Adding some tests refactor

* refactoring operator hub tests for redis operator

* Finding reason for the pending state of redis pod and fix regex format

* Fixing regex format

* Using redis instance CR definition from example file

* Modifying test to use RedisCluster operator

* Fixing redis-secret failure for specific namespace in the test

* removing not used function for copying example

* Refactoring operator test

* redis pod name are changing so frequently so updating it once again

* Refactored operator link test

* Skipping postgresql test for kubernetes

* Fixing invalid devfile with link

* Fixing file not found error

* Address review comments

* Run all tests on ocp and kubernetes

* Shifting to Redis CRD instead of RedisCluster and review comments

* Fixing failure related to no name

* Address cosmetic changes as per review

* olm installation on minikube
2021-07-06 10:05:27 -04:00

46 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
set -x
# Setup to find nessasary data from cluster setup
## Constants
LIBDIR="./scripts/configure-cluster"
LIBCOMMON="$LIBDIR/common"
SETUP_OPERATORS="$LIBCOMMON/setup-operators.sh"
SETUP_POSTGRES_OPERATOR="$LIBCOMMON/setup-postgres-operator.sh"
AUTH_SCRIPT="$LIBCOMMON/auth.sh"
KUBEADMIN_SCRIPT="$LIBCOMMON/kubeconfigandadmin.sh"
POSTGRES_OPERATOR_PROJECT="odo-operator-test"
# list of namespace to create
IMAGE_TEST_NAMESPACES="openjdk-11-rhel8 nodejs-12-rhel7 nodejs-12 openjdk-11 nodejs-14"
. $KUBEADMIN_SCRIPT
. $SETUP_POSTGRES_OPERATOR
# Setup the cluster for Operator tests
sh $SETUP_OPERATORS
oc new-project $POSTGRES_OPERATOR_PROJECT
# Let developer user have access to the project
oc adm policy add-role-to-user edit developer
install_postgres_operator $POSTGRES_OPERATOR_PROJECT
# OperatorHub setup complete
# Create the namespace for e2e image test apply pull secret to the namespace
for i in `echo $IMAGE_TEST_NAMESPACES`; do
# create the namespace
oc new-project $i
# Applying pull secret to the namespace which will be used for pulling images from authenticated registry
oc get secret pull-secret -n openshift-config -o yaml | sed "s/openshift-config/$i/g" | oc apply -f -
# Let developer user have access to the project
oc adm policy add-role-to-user edit developer
done
# Workarounds - Note we should find better soulutions asap
# Missing wildfly in OpenShift Adding it manually to cluster Please remove once wildfly is again visible
oc apply -n openshift -f https://raw.githubusercontent.com/openshift/library/master/arch/x86_64/community/wildfly/imagestreams/wildfly-centos7.json
sh $AUTH_SCRIPT