Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/tutorials/examples/ldap-auth/40-modify-superset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
sleep 2 # just to be sure we're up and running
2 changes: 2 additions & 0 deletions modules/tutorials/examples/ldap-auth/60-modify-trino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions modules/tutorials/examples/ldap-auth/80-verify-trino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
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 ...";
curl -s --output "$trino_binary" "$trino_download_url"
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)

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/tutorials/examples/ldap-auth/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -21,4 +21,4 @@ superset_login() {
return 0
fi
return 1
}
}
Loading