diff --git a/modules/tutorials/examples/ldap-auth/40-modify-superset.sh b/modules/tutorials/examples/ldap-auth/40-modify-superset.sh index 27d012bb7..aece8a986 100755 --- a/modules/tutorials/examples/ldap-auth/40-modify-superset.sh +++ b/modules/tutorials/examples/ldap-auth/40-modify-superset.sh @@ -29,7 +29,9 @@ echo "Applying updated configuration" kubectl apply -f superset.yaml # end::apply-superset-cluster[] +sleep 1 # it takes time before the statefulset is recreated + echo "Waiting for superset StatefulSet ..." kubectl rollout status --watch statefulset/superset-node-default -sleep 2 # just to be sure we're up and running \ No newline at end of file +sleep 2 # just to be sure we're up and running diff --git a/modules/tutorials/examples/ldap-auth/60-modify-trino.sh b/modules/tutorials/examples/ldap-auth/60-modify-trino.sh index 371f792ed..230c971e7 100755 --- a/modules/tutorials/examples/ldap-auth/60-modify-trino.sh +++ b/modules/tutorials/examples/ldap-auth/60-modify-trino.sh @@ -31,6 +31,8 @@ echo "Applying updated configuration" kubectl apply -f trino.yaml # end::apply[] +sleep 1 # it takes time before the statefulset is recreated + echo "Waiting for Trino StatefulSets rollout ..." kubectl rollout status --watch statefulset/trino-coordinator-default kubectl rollout status --watch statefulset/trino-worker-default diff --git a/modules/tutorials/examples/ldap-auth/80-verify-trino.sh b/modules/tutorials/examples/ldap-auth/80-verify-trino.sh index 01b50090b..4abe0be8d 100755 --- a/modules/tutorials/examples/ldap-auth/80-verify-trino.sh +++ b/modules/tutorials/examples/ldap-auth/80-verify-trino.sh @@ -2,15 +2,15 @@ set -euo pipefail -trino_version="476" -trino_download_url="https://repo.stackable.tech/repository/packages/trino-cli/trino-cli-${trino_version}-executable.jar" +trino_version="479" +trino_download_url="https://repo.stackable.tech/repository/packages/trino-cli/trino-cli-${trino_version}" trino_login() { local username="$1" local password="$2" - trino_binary="./trino.jar" + trino_binary="./trino-cli" if [[ ! -f "$trino_binary" ]]; then echo "Downloading trino client ..."; @@ -18,7 +18,7 @@ trino_login() { chmod +x "$trino_binary" fi - trino_addr=$(stackablectl svc list -o json | jq --raw-output '.trino| .[0] | .endpoints | .["coordinator-https"]') + trino_addr=$(stackablectl stacklet list -o json | jq --raw-output '.[] | select(.name == "trino") | .endpoints | .["coordinator-https"]') output=$(echo "$password" | "$trino_binary" --insecure --output-format=CSV_UNQUOTED --server "$trino_addr" --user "$username" --execute "SHOW CATALOGS" --password) @@ -33,7 +33,7 @@ password="alice" echo "Testing trino login with $username:$password ..." if trino_login "$username" "$password"; then - echo "Login sucessful" + echo "Login successful" else echo "Login unsuccessful" exit 1 diff --git a/modules/tutorials/examples/ldap-auth/utils.sh b/modules/tutorials/examples/ldap-auth/utils.sh index 70935913a..bd203ae9c 100644 --- a/modules/tutorials/examples/ldap-auth/utils.sh +++ b/modules/tutorials/examples/ldap-auth/utils.sh @@ -9,7 +9,7 @@ superset_login() { request_data=$(printf '{"provider": "%s", "username": "%s", "password": "%s", "refresh": false}' "$provider" "$username" "$password") local superset_addr - superset_addr=$(stackablectl svc list -o json | jq --raw-output '.superset| .[0] | .endpoints | .["external-superset"]') + superset_addr=$(stackablectl stacklet list -o json | jq --raw-output '.[] | select(.name == "superset") | .endpoints | .["node-http"]') local superset_endpoint="$superset_addr"/api/v1/security/login json_header='Content-Type: application/json' @@ -21,4 +21,4 @@ superset_login() { return 0 fi return 1 -} \ No newline at end of file +}