Skip to content

Commit a46102c

Browse files
saumeyavarshab1210
andauthored
script for running nightly kuttl test (#528)
updated tests for non-olm comment comment minor change review fix review comments changes changes add options for testsuite review comments and updates changes remove empty file changes review fix review changes using temp directory for tests review comments fix fix testing false positives fix fix fix fix Signed-off-by: saumeya <[email protected]> Co-authored-by: Varsha B <[email protected]>
1 parent 5e51eed commit a46102c

File tree

20 files changed

+228
-18
lines changed

20 files changed

+228
-18
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ e2e-tests-parallel:
122122
@echo "Running GitOps Operator parallel E2E tests..."
123123
. ./scripts/run-kuttl-tests.sh parallel
124124

125+
.PHONY: e2e-non-olm-tests-sequential
126+
e2e-non-olm-tests-sequential: ## Runs kuttl non-olm e2e sequentail tests
127+
@echo "Running Non-OLM GitOps Operator sequential E2E tests..."
128+
. ./hack/scripts/run-non-olm-kuttl-test.sh -t sequential
129+
130+
.PHONY: e2e-non-olm-tests-parallel ## Runs kuttl non-olm e2e parallel tests, (Defaults to 5 runs at a time)
131+
e2e-non-olm-tests-parallel:
132+
@echo "Running Non-OLM GitOps Operator parallel E2E tests..."
133+
. ./hack/scripts/run-non-olm-kuttl-test.sh -t parallel
134+
135+
.PHONY: e2e-non-olm-tests-all ## Runs kuttl non-olm e2e parallel tests, (Defaults to 5 runs at a time)
136+
e2e-non-olm-tests-all:
137+
@echo "Running Non-OLM GitOps Operator E2E tests..."
138+
. ./hack/scripts/run-non-olm-kuttl-test.sh -t all
139+
125140
##@ Build
126141

127142
build: generate fmt vet ## Build manager binary.

hack/scripts/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### Non OLM based operator e2e kuttl test
2+
3+
`run-non-olm-kuttl-test.sh` is a bash script utility, that can be used to run the end to end test for Openshift GitOps Operator without using the `Operator Lifecycle Manager (OLM)`.
4+
5+
### Usage
6+
7+
The `run-non-olm-kuttl-test.sh` script needs to be run with argument specifying the test suite to be run with .
8+
9+
run-non-olm-kuttl-test.sh [ -t sequential|parallel|all ]
10+
11+
Example
12+
13+
`./run-non-olm-kuttl-test.sh -t parallel` will run the entire parallel test suite. By default it will run all the tests.
14+
15+
The directories that are not needed for the nightly operator are excluded before running the tests.
16+
If you want to add more excluded tests, you can do so by using an environment variable called `EXCLUDED_TESTS` like so,
17+
18+
`export EXCLUDED_TESTS="1-031_validate_toolchain 1-085_validate_dynamic_plugin_installation 1-038_validate_productized_images"`
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env bash
2+
3+
export NON_OLM="true"
4+
5+
set -x
6+
7+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
8+
sequential_suite=$ROOT/../../test/openshift/e2e/sequential/
9+
parallel_suite=$ROOT/../../test/openshift/e2e/parallel/
10+
11+
testsuite="all"
12+
13+
# Get test suite argument
14+
while getopts ":t:" opt; do
15+
case ${opt} in
16+
t) testsuite=$OPTARG;;
17+
\?) echo "Please provide options sequential/parallel/all -$OPTARG" >&2;;
18+
esac
19+
done
20+
21+
# these tests will be removed while running non-olm operator test
22+
# 1-031_validate_toolchain
23+
# 1-085_validate_dynamic_plugin_installation
24+
# 1-036_validate_keycloak_resource_reqs
25+
# 1-038_validate_productized_images
26+
# 1-051-validate_csv_permissions
27+
# 1-073_validate_rhsso
28+
# 1-077_validate_disable_dex_removed
29+
# 1-090_validate_permissions
30+
31+
filenames="1-031_validate_toolchain 1-085_validate_dynamic_plugin_installation 1-036_validate_keycloak_resource_reqs 1-038_validate_productized_images 1-051-validate_csv_permissions 1-073_validate_rhsso 1-077_validate_disable_dex_removed 1-090_validate_permissions"
32+
33+
if [ -n "$EXCLUDED_TESTS" ]; then
34+
filenames="${filenames} ${EXCLUDED_TESTS}"
35+
fi
36+
37+
temp_dir=$(mktemp -d "${TMPDIR:-"/tmp"}/kuttl-non-olm-tests-XXXXXXX")
38+
39+
cp -R "$sequential_suite" "$temp_dir"
40+
41+
cp -R "$parallel_suite" "$temp_dir"
42+
43+
for dir in $filenames ; do
44+
if [ -d "$temp_dir/sequential/$dir" ]; then
45+
echo "Deleting directory $dir"
46+
rm -rf "$temp_dir/sequential/$dir"
47+
elif [ -d "$temp_dir/parallel/$dir" ]; then
48+
echo "Deleting directory $dir"
49+
rm -rf "$temp_dir/parallel/$dir"
50+
else
51+
echo "Directory $dir does not exist"
52+
fi
53+
done
54+
55+
#replace the namespace for assert in test file
56+
57+
sed -i 's/openshift-operators/gitops-operator-system/g' $temp_dir/sequential/1-018_validate_disable_default_instance/02-assert.yaml \
58+
$temp_dir/sequential/1-035_validate_argocd_secret_repopulate/04-check_controller_pod_status.yaml
59+
60+
cleanup() {
61+
rm -rf "$temp_dir"
62+
echo "Deleted temp test directory $temp_dir"
63+
}
64+
65+
trap cleanup EXIT INT
66+
67+
script="$ROOT/../../scripts/run-kuttl-tests.sh"
68+
69+
# Check if the file exists before executing it
70+
if [ -e "$script" ]; then
71+
chmod +x "$script"
72+
else
73+
echo "ERROR: Script file '$script' not found."
74+
fi
75+
76+
export TEST_BASE_DIR=$temp_dir
77+
78+
# Run the specific test suite
79+
case "$testsuite" in
80+
"parallel")
81+
source "$script" parallel
82+
;;
83+
"sequential")
84+
source "$script" sequential
85+
;;
86+
"all")
87+
source "$script" all
88+
;;
89+
*)
90+
echo "USAGE: $0 (parallel|sequential|all)" >&2
91+
exit 1
92+
esac

scripts/run-kuttl-tests.sh

100644100755
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ cleanup() {
2929

3030
# Simple wrapper to run the acceptance tests for GitOps Operator
3131

32+
33+
TEST_BASE_DIR=${TEST_BASE_DIR:-"$DIR/../test/openshift/e2e"}
34+
3235
run_parallel() {
3336
if test -f $WORK_DIR/results/kuttl-test.$report; then
3437
rm -f $WORK_DIR/results/kuttl-test.$report
3538
fi
3639

3740
echo "Running parallel test suite"
38-
kubectl kuttl test $DIR/../test/openshift/e2e/parallel --artifacts-dir $WORK_DIR/results --config $DIR/../test/openshift/e2e/parallel/kuttl-test.yaml --report $report 2>&1 | tee $WORK_DIR/results/$testsuite.log
41+
kubectl kuttl test $TEST_BASE_DIR/parallel --artifacts-dir $WORK_DIR/results --config $DIR/../test/openshift/e2e/parallel/kuttl-test.yaml --report $report 2>&1 | tee $WORK_DIR/results/$testsuite.log
3942
if [ ${PIPESTATUS[0]} != 0 ]; then
4043
failed=1
4144
fi
@@ -47,7 +50,7 @@ run_sequential() {
4750
fi
4851

4952
echo "Running sequential test suite"
50-
kubectl kuttl test $DIR/../test/openshift/e2e/sequential --artifacts-dir $WORK_DIR/results --config $DIR/../test/openshift/e2e/sequential/kuttl-test.yaml --report $report 2>&1 | tee $WORK_DIR/results/$testsuite.log
53+
kubectl kuttl test $TEST_BASE_DIR/sequential --artifacts-dir $WORK_DIR/results --config $DIR/../test/openshift/e2e/sequential/kuttl-test.yaml --report $report 2>&1 | tee $WORK_DIR/results/$testsuite.log
5154
if [ ${PIPESTATUS[0]} != 0 ]; then
5255
failed=1
5356
fi

test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/02-patch-subscription.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ kind: TestStep
33
commands:
44
# patches the subscription to set an environment variable
55
- script: |
6-
if [ -z $CI ]; then
6+
if ! [ -z $NON_OLM ]; then
7+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
8+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":"true"}]}]}}}}'
9+
10+
elif [ -z $CI ]; then
711
812
oc patch -n openshift-operators subscription openshift-gitops-operator \
913
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_INSTANCE", "value": "true"}]}}}'

test/openshift/e2e/ignore-tests/sequential/1-018_validate_disable_default_instance/04-patch-subscription.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ kind: TestStep
33
commands:
44
# patches the subscription to set an environment variable
55
- script: |
6-
if [ -z $CI ]; then
6+
if ! [ -z $NON_OLM ]; then
7+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
8+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_INSTANCE","value":null}]}]}}}}'
9+
10+
elif [ -z $CI ]; then
711
812
oc patch -n openshift-operators subscription openshift-gitops-operator \
913
--type json --patch '[{"op": "remove", "path": "/spec/config"}]'

test/openshift/e2e/sequential/1-034_validate_custom_roles/02-patch-subscription.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ apiVersion: kuttl.dev/v1beta1
33
kind: TestStep
44
commands:
55
- script: |
6-
if ! [ -z $CI ]; then
76
7+
if ! [ -z $NON_OLM ]; then
8+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
9+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":"custom-argocd-role"},{"name":"SERVER_CLUSTER_ROLE", "value":"custom-argocd-role"}]}]}}}}'
10+
11+
elif ! [ -z $CI ]; then
12+
813
oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'`\
914
--type merge --patch '{"spec": {"config": {"env": [{"name": "CONTROLLER_CLUSTER_ROLE", "value": "custom-argocd-role"},{"name": "SERVER_CLUSTER_ROLE", "value": "custom-argocd-role"}]}}}'
1015

test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if ! [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"CONTROLLER_CLUSTER_ROLE","value":null},{"name":"SERVER_CLUSTER_ROLE", "value":null}]}]}}}}'
8+
9+
elif ! [ -z $CI ]; then
610
oc patch -n openshift-operators subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]'
711
else
812
oc patch subscription/openshift-gitops-operator -n openshift-operators --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]'

test/openshift/e2e/sequential/1-050_validate_sso_config/04-disable-dex-through-sub.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":"true"}]}]}}}}'
8+
9+
elif [ -z $CI ]; then
610
711
oc patch -n openshift-operators subscription openshift-gitops-operator \
812
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": "true"}]}}}'

test/openshift/e2e/sequential/1-050_validate_sso_config/05-unset-disable-dex-env-var.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEX","value":""}]}]}}}}'
8+
9+
elif [ -z $CI ]; then
610
711
oc patch -n openshift-operators subscription openshift-gitops-operator \
812
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEX", "value": ""}]}}}'

test/openshift/e2e/sequential/1-056_validate_managed-by/04-add_env.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ commands:
44
# patches the subscription to set the environment variable
55
- script: |
66
set -e
7-
if [ -z $CI ]; then
7+
8+
if ! [ -z $NON_OLM ]; then
9+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
10+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":"true"}]}]}}}}'
11+
12+
elif [ -z $CI ]; then
813
914
oc patch -n openshift-operators subscription openshift-gitops-operator \
1015
--type merge --patch '{"spec": {"config": {"env": [{"name": "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION", "value": "true"}]}}}'

test/openshift/e2e/sequential/1-056_validate_managed-by/05-check.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION")|.value')
7+
if [ -z $label_value ]; then
8+
echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set"
9+
exit 1
10+
else
11+
exit 0
12+
fi
13+
elif [ -z $CI ]; then
614
label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION").value')
715
if [ -z $label_value ]; then
816
echo "REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION not set"

test/openshift/e2e/sequential/1-056_validate_managed-by/08-remove_env.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ kind: TestStep
33
commands:
44
# patches the subscription to set an environment variable
55
- script: |
6-
if [ -z $CI ]; then
6+
if ! [ -z $NON_OLM ]; then
7+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
8+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"REMOVE_MANAGED_BY_LABEL_ON_ARGOCD_DELETION","value":null}]}]}}}}'
9+
elif [ -z $CI ]; then
710
oc patch -n openshift-operators subscription openshift-gitops-operator \
811
--type json --patch '[{"op": "remove", "path": "/spec/config"}]'
912
else

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/02-add_env.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"true"}]}]}}}}'
8+
elif [ -z $CI ]; then
69
oc patch -n openshift-operators subscription openshift-gitops-operator \
710
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "true"}]}}}'
811
else

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/03-check-env.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value')
7+
if ! [[ "${label_value}" == '"true"' ]]; then
8+
echo "Label value: $label_value"
9+
echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK not set"
10+
exit 1
11+
else
12+
exit 0
13+
fi
14+
elif [ -z $CI ]; then
615
label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value')
716
if ! [[ "${label_value}" == '"true"' ]]; then
817
echo "Label value: $label_value"

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/04-disable-env.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":"false"}]}]}}}}'
8+
9+
elif [ -z $CI ]; then
610
oc patch -n openshift-operators subscription openshift-gitops-operator \
711
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": "false"}]}}}'
812
else

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/05-check-env.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value')
7+
if ! [[ "${label_value}" == '"false"' ]]; then
8+
echo "Label value: $label_value"
9+
echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK set"
10+
exit 1
11+
else
12+
exit 0
13+
fi
14+
elif [ -z $CI ]; then
615
label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value')
716
817
if ! [[ "${label_value}" == '"false"' ]]; then

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/06-empty-valued-env.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":""}]}]}}}}'
8+
9+
elif [ -z $CI ]; then
610
oc patch -n openshift-operators subscription openshift-gitops-operator \
711
--type merge --patch '{"spec": {"config": {"env": [{"name": "DISABLE_DEFAULT_ARGOCD_CONSOLELINK", "value": ""}]}}}'
812
else

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/07-check-env.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
label_value=$(oc get deployment gitops-operator-controller-manager -n gitops-operator-system -o json | jq -r '.spec.template.spec.containers[]|select(.name=="manager")|.env[] | select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK")|.value')
7+
if ! [[ "${label_value}" == null ]]; then
8+
echo "DISABLE_DEFAULT_ARGOCD_CONSOLELINK is set to ${label_value}"
9+
exit 1
10+
else
11+
exit 0
12+
fi
13+
elif [ -z $CI ]; then
614
label_value=$(oc get subscriptions openshift-gitops-operator -n openshift-operators -o json | jq '.spec.config.env[]|select(.name=="DISABLE_DEFAULT_ARGOCD_CONSOLELINK").value')
715
816
if ! [[ "${label_value}" == '""' ]]; then

test/openshift/e2e/sequential/1-078_validate_default_argocd_consoleLink/08-remove-env.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ apiVersion: kuttl.dev/v1beta1
22
kind: TestStep
33
commands:
44
- script: |
5-
if [ -z $CI ]; then
5+
if ! [ -z $NON_OLM ]; then
6+
oc patch deployment gitops-operator-controller-manager -n gitops-operator-system \
7+
-p '{"spec":{"template":{"spec":{"containers":[{"name":"manager","env":[{"name":"DISABLE_DEFAULT_ARGOCD_CONSOLELINK","value":null}]}]}}}}'
8+
9+
elif [ -z $CI ]; then
610
oc -n openshift-operators patch subscription openshift-gitops-operator --type='json' -p='[{"op": "remove", "path": "/spec/config" }]'
711
else
812
oc -n openshift-operators patch subscription `subscription=gitops-operator- && oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` --type='json' -p='[{"op": "remove", "path": "/spec/config" }]'

0 commit comments

Comments
 (0)