1+ mkdir -p ./temp
2+
3+ if [[ -z " ${NAMESPACE_TO_GENERATE} " ]]; then
4+ export NAMESPACE_TO_GENERATE=" tnf"
5+ fi
6+
7+ export res=$( oc get namespace $NAMESPACE_TO_GENERATE 2>&1 )
8+ if [[ ${res# Error from server (NotFound): } != ${res} ]]; then
9+ cat ./local-test-infra/namespace.yaml | ./script/mo > ./temp/rendered-namespace.yaml
10+ oc apply -f ./temp/rendered-namespace.yaml
11+ rm ./temp/rendered-namespace.yaml
12+ else
13+ echo " namespace ${NAMESPACE_TO_GENERATE} already exists, no reason to recreate"
14+ fi
15+
16+ export res=$( oc get pod -n $NAMESPACE_TO_GENERATE -l test-network-function.com/generic=fs_diff_master 2>&1 )
17+ if [[ ${res# No resources found} != ${res} ]]; then
18+ cat ./local-test-infra/fsdiff-pod.yaml | ./script/mo > ./temp/rendered-fsdiff-template.yaml
19+ oc apply -f ./temp/rendered-fsdiff-template.yaml
20+ rm ./temp/rendered-fsdiff-template.yaml
21+ else
22+ echo " fsDiffMasterPod already exists, no reason to recreate"
23+ fi
24+
25+ export res=$( oc get pod -n $NAMESPACE_TO_GENERATE -l test-network-function.com/generic=target 2>&1 )
26+ if [[ ${res# No resources found} != ${res} ]]; then
27+ cat ./local-test-infra/local-pod-under-test.yaml | ./script/mo > ./temp/rendered-local-pod-under-test-template.yaml
28+ oc apply -f ./temp/rendered-local-pod-under-test-template.yaml
29+ rm ./temp/rendered-local-pod-under-test-template.yaml
30+ else
31+ echo " partner pod already exists, no reason to recreate"
32+ fi
33+
34+ export res=$( oc get pod -n $NAMESPACE_TO_GENERATE -l test-network-function.com/generic=orchestrator 2>&1 )
35+ if [[ ${res# No resources found} != ${res} ]]; then
36+ cat ./local-test-infra/local-partner-pod.yaml | ./script/mo > ./temp/rendered-partner-template.yaml
37+ oc apply -f ./temp/rendered-partner-template.yaml
38+ rm ./temp/rendered-partner-template.yaml
39+ else
40+ echo " partner pod already exists, no reason to recreate"
41+ fi
0 commit comments