Skip to content

Commit fc1c8bc

Browse files
committed
fix: update ConfigMap name in Argo CD root path retrieval script
Change the ConfigMap name from a variable to the actual name 'argocd-cmd-params-cm' in the validate-values.yaml script to ensure correct fetching of the root path. This improves clarity and prevents potential issues with undefined variables.
1 parent 6bf31fe commit fc1c8bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

charts/gitops-runtime/templates/hooks/pre-install/validate-values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ spec:
7070
get_argocd_root_path() {
7171
local root_path
7272
73-
echo "Fetching Argo CD root path from ConfigMap '$ARGOCD_CM_PARAMS_NAME' in namespace '$NAMESPACE'..."
74-
root_path=$(kubectl get configmap "$ARGOCD_CM_PARAMS_NAME" -n "$NAMESPACE" -o jsonpath='{.data.server\.rootpath}' 2>/dev/null || echo "")
73+
echo "Fetching Argo CD root path from ConfigMap 'argocd-cmd-params-cm' in namespace '$NAMESPACE'..."
74+
root_path=$(kubectl get configmap "argocd-cmd-params-cm" -n "$NAMESPACE" -o jsonpath='{.data.server\.rootpath}' 2>/dev/null || echo "")
7575
7676
if [ -n "$root_path" ] && [ "$root_path" != "/" ]; then
7777
root_path=$(echo "$root_path" | sed 's:/*$::') # Remove trailing slash
7878
[ "${root_path#\/}" = "$root_path" ] && root_path="/$root_path" # Add leading slash if missing
7979
elif [ "$root_path" = "/" ]; then
8080
root_path="" # Treat as empty for URL construction
8181
else
82-
echo "Warning: 'server.rootpath' not found in ConfigMap '$ARGOCD_CM_PARAMS_NAME' or ConfigMap not found. Assuming default root path '/'. "
82+
echo "Warning: 'server.rootpath' not found in ConfigMap 'argocd-cmd-params-cm' or ConfigMap not found. Assuming default root path '/'. "
8383
root_path="" # Default to empty string
8484
fi
8585

0 commit comments

Comments
 (0)