Skip to content

Commit

Permalink
adding some log messages to see pod status
Browse files Browse the repository at this point in the history
Signed-off-by: vivekr-splunk <vivekr@splunk.com>
  • Loading branch information
vivekr-splunk committed Oct 3, 2023
1 parent de6957e commit 9c671fb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ -n "${PRIVATE_REGISTRY}" ]; then
PRIVATE_SPLUNK_ENTERPRISE_IMAGE=${PRIVATE_REGISTRY}/${SPLUNK_ENTERPRISE_IMAGE}
echo "docker images -q ${SPLUNK_OPERATOR_IMAGE}"
# Don't pull splunk operator if exists locally since we maybe building it locally
if [ -z $(docker images -q ${SPLUNK_OPERATOR_IMAGE}) ]; then
if [ -z $(docker images -q ${SPLUNK_OPERATOR_IMAGE}) ]; then
docker pull ${SPLUNK_OPERATOR_IMAGE}
if [ $? -ne 0 ]; then
echo "Unable to pull ${SPLUNK_OPERATOR_IMAGE}. Exiting..."
Expand Down Expand Up @@ -55,22 +55,23 @@ if [ -n "${PRIVATE_REGISTRY}" ]; then
docker images
fi

if [ "${DEPLOYMENT_TYPE}" == "helm" ]; then
if [ "${DEPLOYMENT_TYPE}" == "helm" ]; then
echo "Installing Splunk Operator using Helm charts"
helm uninstall splunk-operator -n splunk-operator
if [ "${CLUSTER_WIDE}" != "true" ]; then
helm install splunk-operator --create-namespace --namespace splunk-operator --set splunkOperator.clusterWideAccess=false --set splunkOperator.image.repository=${PRIVATE_SPLUNK_OPERATOR_IMAGE} --set image.repository=${PRIVATE_SPLUNK_ENTERPRISE_IMAGE} helm-chart/splunk-operator
else
helm install splunk-operator --create-namespace --namespace splunk-operator --set splunkOperator.image.repository=${PRIVATE_SPLUNK_OPERATOR_IMAGE} --set image.repository=${PRIVATE_SPLUNK_ENTERPRISE_IMAGE} helm-chart/splunk-operator
fi
elif [ "${CLUSTER_WIDE}" != "true" ]; then
elif [ "${CLUSTER_WIDE}" != "true" ]; then
# Install the CRDs
echo "Installing enterprise CRDs..."
make kustomize
make kustomize
make uninstall
bin/kustomize build config/crd | kubectl create -f -
else
echo "Installing enterprise operator from ${PRIVATE_SPLUNK_OPERATOR_IMAGE}..."
echo 'make deploy IMG=${PRIVATE_SPLUNK_OPERATOR_IMAGE} SPLUNK_ENTERPRISE_IMAGE=${PRIVATE_SPLUNK_ENTERPRISE_IMAGE} WATCH_NAMESPACE=""'
make deploy IMG=${PRIVATE_SPLUNK_OPERATOR_IMAGE} SPLUNK_ENTERPRISE_IMAGE=${PRIVATE_SPLUNK_ENTERPRISE_IMAGE} WATCH_NAMESPACE=""
fi

Expand All @@ -79,13 +80,14 @@ if [ $? -ne 0 ]; then
exit 1
fi

if [ "${CLUSTER_WIDE}" == "true" ]; then
if [ "${CLUSTER_WIDE}" == "true" ]; then
echo "wait for operator pod to be ready..."
# sleep before checking for deployment, in slow clusters deployment call may not even started
# in those cases, kubectl will fail with error: no matching resources found
sleep 2
kubectl wait --for=condition=ready pod -l control-plane=controller-manager --timeout=600s -n splunk-operator
if [ $? -ne 0 ]; then
kubectl get pods -n splunk-operator
echo "Operator installation not ready..."
exit 1
fi
Expand All @@ -98,14 +100,14 @@ if [ -z "$rc" ]; then
go get github.com/onsi/gomega/...

go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
fi
fi


echo "Running test using number of nodes: ${NUM_NODES}"
echo "Running test using these images: ${PRIVATE_SPLUNK_OPERATOR_IMAGE} and ${PRIVATE_SPLUNK_ENTERPRISE_IMAGE}..."


# Check if test focus is set
# Check if test focus is set
if [[ -z "${TEST_FOCUS}" ]]; then
TEST_TO_RUN="${TEST_REGEX}"
echo "Test focus not set running smoke test by default :: ${TEST_TO_RUN}"
Expand Down

0 comments on commit 9c671fb

Please sign in to comment.