# args: -
__ICS_initial_setup() {
use_ics_rest_http
+ export ICS_SIDECAR_JWT_FILE=""
}
# Set app short-name, app name and namespace for logging runtime statistics of kubernets pods or docker containers
# Create app
input_yaml=$SIM_GROUP"/"$ICS_COMPOSE_DIR"/"app.yaml
output_yaml=$PWD/tmp/ics_app.yaml
+ if [ -z "$ICS_SIDECAR_JWT_FILE" ]; then
+ cat $input_yaml | sed '/#ICS_JWT_START/,/#ICS_JWT_STOP/d' > $PWD/tmp/ics_app_tmp.yaml
+ input_yaml=$PWD/tmp/ics_app_tmp.yaml
+ fi
__kube_create_instance app $ICS_APP_NAME $input_yaml $output_yaml
fi
fi
# Tie the ICS 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
+ # A PVC of type hostPath is mounted to A1PMS, for persistent storage, so the A1PMS must always be on the node which mounted the volume
if [ -z "$__ICS_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=$__ICS_WORKER_NODE to deployment for $ICS_APP_NAME. Pod will always run on this worker node: $__PA_WORKER_NODE"$BOLD
+ echo -e $BOLD" Setting nodeSelector kubernetes.io/hostname=$__ICS_WORKER_NODE to deployment for $ICS_APP_NAME. Pod will always run on this worker node: $__ICS_WORKER_NODE"$BOLD
echo -e $BOLD" The mounted volume is mounted as hostPath and only available on that worker node."$BOLD
tmp=$(kubectl $KUBECONF patch deployment $ICS_APP_NAME -n $KUBE_NONRTRIC_NAMESPACE --patch '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "'$__ICS_WORKER_NODE'"}}}}}')
if [ $? -ne 0 ]; then
# (Function for test scripts)
set_ics_trace() {
echo -e $BOLD"Setting ics trace logging"$EBOLD
- curlString="$ICS_SERVICE_PATH/actuator/loggers/org.oransc.information -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
+ curlString="$ICS_SERVICE_PATH$ICS_ACTUATOR -X POST -H Content-Type:application/json -d {\"configuredLevel\":\"trace\"}"
result=$(__do_curl "$curlString")
if [ $? -ne 0 ]; then
__print_err "Could not set trace mode" $@
__log_test_pass
return 0
+}
+
+# args: <realm> <client-name> <client-secret>
+ics_configure_sec() {
+ export ICS_CREDS_GRANT_TYPE="client_credentials"
+ export ICS_CREDS_CLIENT_SECRET=$3
+ export ICS_CREDS_CLIENT_ID=$2
+ export ICS_AUTH_SERVICE_URL=$KEYCLOAK_SERVICE_PATH$KEYCLOAK_TOKEN_URL_PREFIX/$1/protocol/openid-connect/token
+ export ICS_SIDECAR_MOUNT="/token-cache"
+ export ICS_SIDECAR_JWT_FILE=$ICS_SIDECAR_MOUNT"/jwt.txt"
+
+ export AUTHSIDECAR_APP_NAME
+ export AUTHSIDECAR_DISPLAY_NAME
}
\ No newline at end of file