diff --git a/tests/k8s-deploy/run-deploy-test.sh b/tests/k8s-deploy/run-deploy-test.sh index fdc5a1db..c6836ee1 100755 --- a/tests/k8s-deploy/run-deploy-test.sh +++ b/tests/k8s-deploy/run-deploy-test.sh @@ -117,13 +117,11 @@ fi # Add a config file to be picked up by the ConfigMap before starting. echo "dbfc7a4d-44a7-416d-b5f3-29842cc47650" > $test_deployment_dir/configmaps/test-config/test_config -# Add secrets to the deployment spec (references a pre-existing k8s Secret by name) +# Add secrets to the deployment spec (references a pre-existing k8s Secret by name). +# deploy init already writes an empty 'secrets: {}' key, so we replace it +# rather than appending (ruamel.yaml rejects duplicate keys). deployment_spec_file=${test_deployment_dir}/spec.yml -cat << EOF >> ${deployment_spec_file} -secrets: - test-secret: - - TEST_SECRET_KEY -EOF +sed -i 's/^secrets: {}$/secrets:\n test-secret:\n - TEST_SECRET_KEY/' ${deployment_spec_file} # Get the deployment ID for kubectl queries deployment_id=$(cat ${test_deployment_dir}/deployment.yml | cut -d ' ' -f 2)