@@ -38,8 +38,8 @@ prepare_helm_values() {
3838 if [[ " ${INSTALL_ORCHESTRATOR_PLUGINS:- true} " != " true" ]]; then
3939 log_info " Removing orchestrator plugins from Helm values (INSTALL_ORCHESTRATOR_PLUGINS=false)"
4040 if command -v yq & > /dev/null; then
41- # delete any element in dynamicPlugins array where package contains 'orchestrator'
42- yq -i ' del(.global.dynamicPlugins."*" [] | select(.package | test("orchestrator")))' " ${out_file} "
41+ # delete any element in global.dynamic.plugins array where package contains 'orchestrator'
42+ yq -i ' del(.global.dynamic.plugins [] | select(.package | test("orchestrator")))' " ${out_file} "
4343 else
4444 log_warning " yq not found – cannot strip orchestrator plugins."
4545 fi
@@ -61,10 +61,10 @@ perform_helm_install() {
6161 log_debug " Release: ${release_name} , Namespace: ${namespace} , Values: ${value_file} "
6262
6363 local original_values=" ${PIPELINES_ROOT} /config/helm-values/${value_file} "
64-
64+
6565 if [[ ! -f " ${original_values} " ]]; then
66- log_error " Values file not found: ${values_path } "
67- return 1
66+ log_error " Values file not found: ${original_values } "
67+ return 1
6868 fi
6969
7070 # Preprocess values (strip orchestrator plugins when disabled)
@@ -123,7 +123,7 @@ apply_yaml_files() {
123123 done
124124
125125 # Encode URLs for secrets
126- local dh_target_url=$( echo -n " test-backstage-customization-provider-${project} .${K8S_CLUSTER_ROUTER_BASE} " | base64 -w 0 )
126+ local dh_target_url=$( echo -n " test-backstage-customization-provider-${project} .${K8S_CLUSTER_ROUTER_BASE} " | base64 | tr -d ' \n ' )
127127 local rhdh_base_url_encoded=$( echo -n " ${rhdh_base_url} " | base64 | tr -d ' \n' )
128128 local rhdh_base_url_http=$( echo -n " ${rhdh_base_url/ https/ http} " | base64 | tr -d ' \n' )
129129
@@ -303,20 +303,27 @@ configure_external_postgres_db() {
303303 oc apply -f " ${resources_dir} /postgres.yaml" --namespace=" ${NAME_SPACE_POSTGRES_DB} "
304304 sleep 5
305305
306- # Extract certificates
306+ # Extract certificates to a temporary directory (avoid leaving files in repo)
307+ local tmpdir
308+ tmpdir=$( mktemp -d)
309+ log_debug " Using tmpdir ${tmpdir} for PG TLS artifacts"
310+
307311 oc get secret postgress-external-db-cluster-cert -n " ${NAME_SPACE_POSTGRES_DB} " \
308- -o jsonpath=' {.data.ca\.crt}' | base64 --decode > postgres-ca
312+ -o jsonpath=' {.data.ca\.crt}' | base64 --decode > " ${tmpdir} /ca.crt "
309313 oc get secret postgress-external-db-cluster-cert -n " ${NAME_SPACE_POSTGRES_DB} " \
310- -o jsonpath=' {.data.tls\.crt}' | base64 --decode > postgres- tls- crt
314+ -o jsonpath=' {.data.tls\.crt}' | base64 --decode > " ${tmpdir} / tls. crt"
311315 oc get secret postgress-external-db-cluster-cert -n " ${NAME_SPACE_POSTGRES_DB} " \
312- -o jsonpath=' {.data.tls\.key}' | base64 --decode > postgres-tsl- key
313-
314- # Create secret in target namespace
316+ -o jsonpath=' {.data.tls\.key}' | base64 --decode > " ${tmpdir} /tls. key"
317+
318+ # Create / update secret in target namespace with the extracted files
315319 oc create secret generic postgress-external-db-cluster-cert \
316- --from-file=ca.crt=postgres-ca \
317- --from-file=tls.crt=postgres- tls- crt \
318- --from-file=tls.key=postgres-tsl- key \
320+ --from-file=ca.crt=" ${tmpdir} /ca.crt " \
321+ --from-file=tls.crt=" ${tmpdir} / tls. crt" \
322+ --from-file=tls.key=" ${tmpdir} /tls. key" \
319323 --dry-run=client -o yaml | oc apply -f - --namespace=" ${project} "
324+
325+ # Clean up temporary directory
326+ rm -rf " ${tmpdir} "
320327
321328 # Update PostgreSQL credentials
322329 local postgres_password=$( oc get secret/postgress-external-db-pguser-janus-idp \
0 commit comments