Skip to content

Commit 2b87a29

Browse files
authored
fix: Fix the incorrect default McpBridge content generated when the target nacos has auth enabled (#30)
1 parent 472f8fa commit 2b87a29

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

compose/scripts/init.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ initializeGateway() {
381381
initializeMcpBridge() {
382382
echo "Initializing McpBridge resource..."
383383

384-
read -r -d '' content << EOF
384+
read -r -d '' mcpbridgeContent << EOF
385385
apiVersion: networking.higress.io/v1
386386
kind: McpBridge
387387
metadata:
@@ -405,7 +405,7 @@ EOF
405405

406406
if [ -n "$NACOS_USERNAME" ] && [ -n "$NACOS_PASSWORD" ]; then
407407
nacosAuthSecretName="nacos-auth-default"
408-
read -r -d '' content << EOF
408+
read -r -d '' nacosAuthSecretContent << EOF
409409
apiVersion: v1
410410
kind: Secret
411411
metadata:
@@ -417,11 +417,11 @@ data:
417417
nacosPassword: $(echo -n "${NACOS_PASSWORD}" | base64 -w 0)
418418
type: Opaque
419419
EOF
420-
publishConfig "higress-system" "secrets" "${nacosAuthSecretName}" "$content"
420+
publishConfig "higress-system" "secrets" "${nacosAuthSecretName}" "$nacosAuthSecretContent"
421421
fi
422422

423-
read -r -d '' content << EOF
424-
${content}
423+
read -r -d '' mcpbridgeContent << EOF
424+
${mcpbridgeContent}
425425
- domain: ${NACOS_SERVER_DOMAIN}
426426
nacosGroups:
427427
- DEFAULT_GROUP
@@ -433,7 +433,7 @@ ${content}
433433
EOF
434434
fi
435435

436-
publishConfig "higress-system" "mcpbridges" "default" "$content"
436+
publishConfig "higress-system" "mcpbridges" "default" "$mcpbridgeContent"
437437
}
438438

439439
initializeConsole() {

0 commit comments

Comments
 (0)