Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen van Erp <[email protected]>
  • Loading branch information
hierynomus committed Sep 17, 2024
1 parent f411c4b commit 0b6c392
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# kc_username (Keycloak)
# kc_password (Keycloak)
# Examples:
# observability_keycloak_login https://sso.suse.com instruqt suse xxxxxx admin password
# keycloak_login https://sso.suse.com instruqt suse xxxxxx admin password
#######################################
observability_keycloak_login() {
keycloak_login() {
local kc_url=$1
local kc_realm=$2
local kc_client_id=$3
Expand Down Expand Up @@ -43,14 +43,15 @@ observability_keycloak_login() {
# username
# password
# Examples:
# observability_create_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user password
# keycloak_create_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user password group
#######################################
observability_create_user() {
keycloak_create_user() {
local kc_url=$1
local kc_realm=$2
local kc_access_token=$3
local username=$4
local password=$5
local group=$6

local user_request
user_request=$(cat <<EOF
Expand All @@ -60,7 +61,7 @@ observability_create_user() {
"emailVerified": true,
"requiredActions": [],
"email": "$username@instruqt.suse.io",
"groups": ["/stackstate-k8s-troubleshooter"],
"groups": ["$group"],
"credentials": [
{
"type": "password",
Expand All @@ -85,9 +86,9 @@ EOF
# kc_access_token (Keycloak)
# username
# Examples:
# observability_delete_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user
# keycloak_delete_user https://sso.suse.com instruqt $SSO_ACCESS_TOKEN user
#######################################
observability_delete_user() {
keycloak_delete_user() {
local kc_url=$1
local kc_realm=$2
local kc_access_token=$3
Expand Down
6 changes: 5 additions & 1 deletion scripts/observability/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
# Install the SUSE Observability CLI
#######################################
observability_install_cli() {
curl -o- https://dl.stackstate.com/stackstate-cli/install.sh | STS_CLI_LOCATION=/usr/local/bin bash
if [ -x "$(command -v sts)" ]; then
curl -o- https://dl.stackstate.com/stackstate-cli/install.sh | STS_CLI_LOCATION=/usr/local/bin bash
else
echo ">>> sts CLI already installed"
fi
}

0 comments on commit 0b6c392

Please sign in to comment.