@@ -131,26 +131,27 @@ data:
131
131
CLUSTER_DOMAIN=$(oc get cm ibmcloud-cluster-info -n $CSDB_NAMESPACE -o jsonpath='{.data.cluster_address}' 2>/dev/null || echo "")
132
132
133
133
if [[ -z $CLUSTER_DOMAIN ]]; then
134
- error "Could not determine cluster domain from ibmcloud-cluster-info configmap. Please update IDP configuration manually."
134
+ error "❌ Could not determine cluster domain from ibmcloud-cluster-info configmap. Please update IDP configuration manually."
135
135
return 1
136
136
fi
137
137
138
- info "Detected cluster domain: $CLUSTER_DOMAIN"
138
+ info "✅ Detected cluster domain: $CLUSTER_DOMAIN"
139
139
140
140
NEW_IDP_URL="https://${CLUSTER_DOMAIN}/idprovider/v1/auth"
141
141
142
- info "Target IDP URL: $NEW_IDP_URL"
142
+ info "🎯 Target IDP URL: $NEW_IDP_URL"
143
143
144
144
# Check if account_iam database exists
145
145
ACCOUNT_IAM_EXISTS=$(oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -c "\list" | grep "account_iam" || echo False)
146
146
147
147
if [[ $ACCOUNT_IAM_EXISTS != "False" ]]; then
148
148
# Check current IDP configuration
149
- CURRENT_IDP=$(oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -d account_iam -t -c "SELECT DISTINCT idp FROM accountiam.idp_config WHERE idp LIKE '%/idprovider/v1/%' LIMIT 1;" | xargs || echo "")
149
+ CURRENT_IDP=$(oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -d account_iam -t -c "SELECT TRIM(idp) FROM accountiam.idp_config WHERE idp LIKE '%/idprovider/v1/%' LIMIT 1;" 2>/dev/null | head -n1 | tr -d '\r\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' || echo "")
150
+ info "🌐 Current IDP URL: $CURRENT_IDP"
151
+ echo ""
150
152
151
153
if [[ -n $CURRENT_IDP ]] && [[ $CURRENT_IDP != $NEW_IDP_URL ]]; then
152
- info "Current IDP URL: $CURRENT_IDP"
153
- info "Updating IDP configuration..."
154
+ info "🔄 Updating IDP configuration..."
154
155
155
156
oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -d account_iam -c "
156
157
UPDATE accountiam.idp_config
@@ -168,7 +169,7 @@ data:
168
169
169
170
success "IDP configuration updated successfully in account_iam database."
170
171
elif [[ $CURRENT_IDP == $NEW_IDP_URL ]]; then
171
- info "IDP configuration already matches target URL, no update needed."
172
+ info "✅ IDP configuration already matches target URL, no update needed."
172
173
else
173
174
info "No IDP configuration found in database, skipping update."
174
175
fi
0 commit comments