diff --git a/scripts/delete-network-policies.sh b/scripts/delete-network-policies.sh index 17aef5dd..ca17bfb8 100755 --- a/scripts/delete-network-policies.sh +++ b/scripts/delete-network-policies.sh @@ -10,9 +10,7 @@ oc delete --filename ./test-target/egress-deny-all-np.yaml --namespace "$TNF_EXA # Render the script with vars mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/pod-to-pod-np.yaml | TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo >./temp/rendered-pod-to-pod-np.yaml +TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo ./test-target/pod-to-pod-np.yaml >./temp/rendered-pod-to-pod-np.yaml oc delete --filename ./temp/rendered-pod-to-pod-np.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" --ignore-not-found oc delete --filename ./temp/rendered-pod-to-pod-np.yaml --namespace default --ignore-not-found rm ./temp/rendered-pod-to-pod-np.yaml diff --git a/scripts/delete-pod-disruption-budget.sh b/scripts/delete-pod-disruption-budget.sh index 9af0bf4e..f660de80 100755 --- a/scripts/delete-pod-disruption-budget.sh +++ b/scripts/delete-pod-disruption-budget.sh @@ -8,8 +8,6 @@ source "$SCRIPT_DIR"/init-env.sh # Delete test PDB mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/pod-disruption-budget.yaml | APP_1="testdp" APP_2="testss" "$SCRIPT_DIR"/mo >./temp/rendered-pod-disruption-budget-template.yaml +APP_1="testdp" APP_2="testss" "$SCRIPT_DIR"/mo ./test-target/pod-disruption-budget.yaml >./temp/rendered-pod-disruption-budget-template.yaml oc delete --filename ./temp/rendered-pod-disruption-budget-template.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" --ignore-not-found=true rm ./temp/rendered-pod-disruption-budget-template.yaml diff --git a/scripts/delete-storage.sh b/scripts/delete-storage.sh index c0e3288e..7b94c4e3 100755 --- a/scripts/delete-storage.sh +++ b/scripts/delete-storage.sh @@ -8,7 +8,6 @@ source "$SCRIPT_DIR"/init-env.sh mkdir -p ./temp -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/storage.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-test-storage.yaml +"$SCRIPT_DIR"/mo ./test-target/storage.yaml >./temp/rendered-test-storage.yaml oc delete --filename ./temp/rendered-test-storage.yaml -n "$TNF_EXAMPLE_CNF_NAMESPACE" --ignore-not-found=true rm ./temp/rendered-test-storage.yaml diff --git a/scripts/deploy-community-operator.sh b/scripts/deploy-community-operator.sh index 39f6577e..c8cc6bfb 100755 --- a/scripts/deploy-community-operator.sh +++ b/scripts/deploy-community-operator.sh @@ -45,24 +45,19 @@ fi # Create the operator group mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/community-operator-group.yaml | TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo >./temp/rendered-local-community-operator-group.yaml +TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo ./test-target/community-operator-group.yaml >./temp/rendered-local-community-operator-group.yaml oc apply --filename ./temp/rendered-local-community-operator-group.yaml cat ./temp/rendered-local-community-operator-group.yaml rm ./temp/rendered-local-community-operator-group.yaml # Create the Subscription mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/community-operator-subscription.yaml | - OPERATOR_BASE=$COMMUNITY_OPERATOR_BASE \ - OPERATOR_NAME=$COMMUNITY_OPERATOR_NAME \ - CATALOG_SOURCE=$CATALOG_SOURCE \ - CATALOG_NAMESPACE=$CATALOG_NAMESPACE \ - TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE \ - "$SCRIPT_DIR"/mo >./temp/rendered-local-community-operator-subscription.yaml +OPERATOR_BASE=$COMMUNITY_OPERATOR_BASE \ + OPERATOR_NAME=$COMMUNITY_OPERATOR_NAME \ + CATALOG_SOURCE=$CATALOG_SOURCE \ + CATALOG_NAMESPACE=$CATALOG_NAMESPACE \ + TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE \ + "$SCRIPT_DIR"/mo ./test-target/community-operator-subscription.yaml >./temp/rendered-local-community-operator-subscription.yaml oc apply --filename ./temp/rendered-local-community-operator-subscription.yaml cat ./temp/rendered-local-community-operator-subscription.yaml rm ./temp/rendered-local-community-operator-subscription.yaml diff --git a/scripts/deploy-cpu-scheduling-test-pods.sh b/scripts/deploy-cpu-scheduling-test-pods.sh index 33ea6736..fe11d42a 100755 --- a/scripts/deploy-cpu-scheduling-test-pods.sh +++ b/scripts/deploy-cpu-scheduling-test-pods.sh @@ -6,12 +6,8 @@ SCRIPT_DIR=$(dirname "$0") # shellcheck disable=SC1091 # Not following. source "$SCRIPT_DIR"/init-env.sh mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/cpu-exclusive-pool-rt-sched-policy-pod.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-cpu-exclusive-pool-rt-sched-policy-pod.yaml - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/cpu-shared-pool-non-rt-sched-policy-pod.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-cpu-shared-pool-non-rt-sched-policy-pod.yaml +"$SCRIPT_DIR"/mo ./test-target/cpu-exclusive-pool-rt-sched-policy-pod.yaml >./temp/rendered-cpu-exclusive-pool-rt-sched-policy-pod.yaml +"$SCRIPT_DIR"/mo ./test-target/cpu-shared-pool-non-rt-sched-policy-pod.yaml >./temp/rendered-cpu-shared-pool-non-rt-sched-policy-pod.yaml oc apply --filename ./temp/rendered-cpu-exclusive-pool-rt-sched-policy-pod.yaml oc apply --filename ./temp/rendered-cpu-shared-pool-non-rt-sched-policy-pod.yaml rm ./temp/rendered-cpu-exclusive-pool-rt-sched-policy-pod.yaml diff --git a/scripts/deploy-multus-network.sh b/scripts/deploy-multus-network.sh index 07fb3f9f..eaa80ccd 100755 --- a/scripts/deploy-multus-network.sh +++ b/scripts/deploy-multus-network.sh @@ -49,8 +49,8 @@ if $TNF_NON_OCP_CLUSTER; then # Creates the network attachment with ptp plugin on partner namespace mkdir -p ./temp - # shellcheck disable=SC2002,SC2001 # Useless cat, echo. - cat ./config/k8s-cluster/multus.yaml | IP_NUM=$(echo "$2" | sed 's/NUM/'"${NUM}"'/g') NET_NAME_NUM="$NET_NAME-$1-$NUM" "$SCRIPT_DIR"/mo >./temp/rendered-multus.yaml + # shellcheck disable=SC2001 # Useless echo. + IP_NUM=$(echo "$2" | sed 's/NUM/'"${NUM}"'/g') NET_NAME_NUM="$NET_NAME-$1-$NUM" "$SCRIPT_DIR"/mo ./config/k8s-cluster/multus.yaml >./temp/rendered-multus.yaml oc apply --filename ./temp/rendered-multus.yaml rm ./temp/rendered-multus.yaml done diff --git a/scripts/deploy-network-policies.sh b/scripts/deploy-network-policies.sh index c111da08..b0fc5f2b 100755 --- a/scripts/deploy-network-policies.sh +++ b/scripts/deploy-network-policies.sh @@ -15,9 +15,7 @@ oc apply --filename ./test-target/egress-deny-all-np.yaml --namespace "$TNF_EXAM # Render the script with vars mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/pod-to-pod-np.yaml | TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo >./temp/rendered-pod-to-pod-np.yaml +TNF_EXAMPLE_CNF_NAMESPACE=$TNF_EXAMPLE_CNF_NAMESPACE "$SCRIPT_DIR"/mo ./test-target/pod-to-pod-np.yaml >./temp/rendered-pod-to-pod-np.yaml # Apply policies to allow pod-to-pod communication (aka make the ping test work) oc apply --filename ./temp/rendered-pod-to-pod-np.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" diff --git a/scripts/deploy-pod-disruption-budget.sh b/scripts/deploy-pod-disruption-budget.sh index eacf6f14..9547eb37 100755 --- a/scripts/deploy-pod-disruption-budget.sh +++ b/scripts/deploy-pod-disruption-budget.sh @@ -7,7 +7,6 @@ SCRIPT_DIR=$(dirname "$0") source "$SCRIPT_DIR"/init-env.sh mkdir -p ./temp -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/pod-disruption-budget.yaml | APP_1="testdp" APP_2="testss" "$SCRIPT_DIR"/mo >./temp/rendered-pod-disruption-budget-template.yaml +APP_1="testdp" APP_2="testss" "$SCRIPT_DIR"/mo ./test-target/pod-disruption-budget.yaml >./temp/rendered-pod-disruption-budget-template.yaml oc apply --filename ./temp/rendered-pod-disruption-budget-template.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" rm ./temp/rendered-pod-disruption-budget-template.yaml diff --git a/scripts/deploy-statefulset-test-pods.sh b/scripts/deploy-statefulset-test-pods.sh index c7eb0455..69170cf4 100755 --- a/scripts/deploy-statefulset-test-pods.sh +++ b/scripts/deploy-statefulset-test-pods.sh @@ -15,9 +15,7 @@ NUM_NODES="${NUM_NODES%"${NUM_NODES##*[![:space:]]}"}" if [[ $NUM_NODES == 1 ]]; then REPLICAS=1 fi - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/local-pod-under-test.yaml | APP="testss" RESOURCE_TYPE="StatefulSet" MULTUS_ANNOTATION=$MULTUS_ANNOTATION REPLICAS=$REPLICAS "$SCRIPT_DIR"/mo >./temp/rendered-local-statefulset-pod-under-test-template.yaml +APP="testss" RESOURCE_TYPE="StatefulSet" MULTUS_ANNOTATION=$MULTUS_ANNOTATION REPLICAS=$REPLICAS "$SCRIPT_DIR"/mo ./test-target/local-pod-under-test.yaml >./temp/rendered-local-statefulset-pod-under-test-template.yaml oc apply --filename ./temp/rendered-local-statefulset-pod-under-test-template.yaml rm ./temp/rendered-local-statefulset-pod-under-test-template.yaml sleep 3 diff --git a/scripts/deploy-storage.sh b/scripts/deploy-storage.sh index 32dc4c38..3eba1d1d 100755 --- a/scripts/deploy-storage.sh +++ b/scripts/deploy-storage.sh @@ -8,7 +8,6 @@ source "$SCRIPT_DIR"/init-env.sh mkdir -p ./temp -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/storage.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-test-storage.yaml +"$SCRIPT_DIR"/mo ./test-target/storage.yaml >./temp/rendered-test-storage.yaml oc apply --filename ./temp/rendered-test-storage.yaml --namespace "$TNF_EXAMPLE_CNF_NAMESPACE" rm ./temp/rendered-test-storage.yaml diff --git a/scripts/deploy-test-pods.sh b/scripts/deploy-test-pods.sh index dcf247d9..da86f34f 100755 --- a/scripts/deploy-test-pods.sh +++ b/scripts/deploy-test-pods.sh @@ -15,11 +15,8 @@ NUM_NODES="${NUM_NODES%"${NUM_NODES##*[![:space:]]}"}" if [[ $NUM_NODES == 1 ]]; then REPLICAS=1 fi - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/test-service-account.yaml | "$SCRIPT_DIR"/mo >./temp/rendered-test-service-account-template.yaml -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/local-pod-under-test.yaml | APP="testdp" RESOURCE_TYPE="Deployment" MULTUS_ANNOTATION=$MULTUS_ANNOTATION REPLICAS=$REPLICAS "$SCRIPT_DIR"/mo >./temp/rendered-local-pod-under-test-template.yaml +"$SCRIPT_DIR"/mo ./test-target/test-service-account.yaml >./temp/rendered-test-service-account-template.yaml +APP="testdp" RESOURCE_TYPE="Deployment" MULTUS_ANNOTATION=$MULTUS_ANNOTATION REPLICAS=$REPLICAS "$SCRIPT_DIR"/mo ./test-target/local-pod-under-test.yaml >./temp/rendered-local-pod-under-test-template.yaml oc apply --filename ./temp/rendered-test-service-account-template.yaml oc apply --filename ./temp/rendered-local-pod-under-test-template.yaml rm ./temp/rendered-test-service-account-template.yaml ./temp/rendered-local-pod-under-test-template.yaml diff --git a/scripts/manage-service.sh b/scripts/manage-service.sh index b0842681..54f0092c 100755 --- a/scripts/manage-service.sh +++ b/scripts/manage-service.sh @@ -27,14 +27,11 @@ fi # ipv6 service mkdir -p ./temp - -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/service.yaml | SERVICE_NAME="test-service-dualstack" APP="testdp" IP_FAMILY_POLICY="PreferDualStack" IP_FAMILIES='["IPv4","IPv6"]' "$SCRIPT_DIR"/mo >./temp/rendered-local-service-under-test-template.yaml +SERVICE_NAME="test-service-dualstack" APP="testdp" IP_FAMILY_POLICY="PreferDualStack" IP_FAMILIES='["IPv4","IPv6"]' "$SCRIPT_DIR"/mo ./test-target/service.yaml >./temp/rendered-local-service-under-test-template.yaml oc $ACTION --filename ./temp/rendered-local-service-under-test-template.yaml rm ./temp/rendered-local-service-under-test-template.yaml # dual stack service -# shellcheck disable=SC2002 # Useless cat. -cat ./test-target/service.yaml | SERVICE_NAME="test-service-ipv6" APP="testdp" IP_FAMILY_POLICY="SingleStack" IP_FAMILIES='["IPv6"]' "$SCRIPT_DIR"/mo >./temp/rendered-local-service-under-test-template.yaml +SERVICE_NAME="test-service-ipv6" APP="testdp" IP_FAMILY_POLICY="SingleStack" IP_FAMILIES='["IPv6"]' "$SCRIPT_DIR"/mo ./test-target/service.yaml >./temp/rendered-local-service-under-test-template.yaml oc $ACTION --filename ./temp/rendered-local-service-under-test-template.yaml rm ./temp/rendered-local-service-under-test-template.yaml