@@ -125,26 +125,27 @@ data:
125
125
CLUSTER_DOMAIN=$(oc get cm ibmcloud-cluster-info -n $CSDB_NAMESPACE -o jsonpath='{.data.cluster_address}' 2>/dev/null || echo "")
126
126
127
127
if [[ -z $CLUSTER_DOMAIN ]]; then
128
- error "Could not determine cluster domain from ibmcloud-cluster-info configmap. Please update IDP configuration manually."
128
+ error "❌ Could not determine cluster domain from ibmcloud-cluster-info configmap. Please update IDP configuration manually."
129
129
return 1
130
130
fi
131
131
132
- info "Detected cluster domain: $CLUSTER_DOMAIN"
132
+ info "✅ Detected cluster domain: $CLUSTER_DOMAIN"
133
133
134
134
NEW_IDP_URL="https://${CLUSTER_DOMAIN}/idprovider/v1/auth"
135
135
136
- info "Target IDP URL: $NEW_IDP_URL"
136
+ info "🎯 Target IDP URL: $NEW_IDP_URL"
137
137
138
138
# Check if account_iam database exists
139
139
ACCOUNT_IAM_EXISTS=$(oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -c "\list" | grep "account_iam" || echo False)
140
140
141
141
if [[ $ACCOUNT_IAM_EXISTS != "False" ]]; then
142
142
# Check current IDP configuration
143
- 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 "")
143
+ 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 "")
144
+ info "🌐 Current IDP URL: $CURRENT_IDP"
145
+ echo ""
144
146
145
147
if [[ -n $CURRENT_IDP ]] && [[ $CURRENT_IDP != $NEW_IDP_URL ]]; then
146
- info "Current IDP URL: $CURRENT_IDP"
147
- info "Updating IDP configuration..."
148
+ info "🔄 Updating IDP configuration..."
148
149
149
150
oc -n $CSDB_NAMESPACE exec -t $CNPG_PRIMARY_POD -c postgres -- psql -U postgres -d account_iam -c "
150
151
UPDATE accountiam.idp_config
@@ -162,7 +163,7 @@ data:
162
163
163
164
success "IDP configuration updated successfully in account_iam database."
164
165
elif [[ $CURRENT_IDP == $NEW_IDP_URL ]]; then
165
- info "IDP configuration already matches target URL, no update needed."
166
+ info "✅ IDP configuration already matches target URL, no update needed."
166
167
else
167
168
info "No IDP configuration found in database, skipping update."
168
169
fi
0 commit comments