+# Start a previously stopped ecs
+# args: -
+# (Function for test scripts)
+start_stopped_ecs() {
+ echo -e $BOLD"Starting (the previously stopped) $ECS_DISPLAY_NAME"$EBOLD
+
+ if [ $RUNMODE == "KUBE" ]; then
+
+ # Tie the PMS to the same worker node it was initially started on
+ # A PVC of type hostPath is mounted to PMS, for persistent storage, so the PMS must always be on the node which mounted the volume
+ if [ -z "$__ECS_WORKER_NODE" ]; then
+ echo -e $RED" No initial worker node found for pod "$RED
+ ((RES_CONF_FAIL++))
+ return 1
+ else
+ echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__ECS_WORKER_NODE to deployment for $ECS_APP_NAME. Pod will always run on this worker node: $__PA_WORKER_NODE"$BOLD
+ echo -e $BOLD" The mounted volume is mounted as hostPath and only available on that worker node."$BOLD
+ tmp=$(kubectl patch deployment $ECS_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE --patch '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "'$__ECS_WORKER_NODE'"}}}}}')
+ if [ $? -ne 0 ]; then
+ echo -e $YELLOW" Cannot set nodeSelector to deployment for $ECS_APP_NAME, persistency may not work"$EYELLOW
+ fi
+ __kube_scale deployment $ECS_APP_NAME $KUBE_NONRTRIC_NAMESPACE 1
+ fi
+
+ else
+ docker start $ECS_APP_NAME &> ./tmp/.dockererr
+ if [ $? -ne 0 ]; then
+ __print_err "Could not start (the stopped) $ECS_APP_NAME" $@
+ cat ./tmp/.dockererr
+ ((RES_CONF_FAIL++))
+ return 1
+ fi
+ fi