From 452c426df4267d271543d70b4a43e1e4d534f9eb Mon Sep 17 00:00:00 2001 From: ties Date: Thu, 29 Aug 2024 12:11:08 +0000 Subject: [PATCH] Update createServiceAccount.sh --- createServiceAccount.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/createServiceAccount.sh b/createServiceAccount.sh index 5a4d1d3..95951aa 100644 --- a/createServiceAccount.sh +++ b/createServiceAccount.sh @@ -1,19 +1,13 @@ #!/bin/bash -# Extract namespace from values.yaml using yq NAMESPACE=$(yq e '.namespace' values.yaml) - -# Set the ServiceAccount, Role, and RoleBinding names based on the namespace SA_NAME="${NAMESPACE}-cicd" -# Capture Helm template output directly with dynamic subchartData +helm dependency build . HELM_OUTPUT=$(helm template -g --set-json="subchartData=$(yq '.dependencies[0]' Chart.yaml -ojson | jq -rc)" .) -# Extract unique apiVersion and kind pairs using yq and jq resources=$(echo "$HELM_OUTPUT" | yq -o=json | jq -rc '{apiVersion, kind}' | sort | uniq) -echo "$resources" - cat <