feat: allow specifying base64-encoded values in vector-sink DSN urls

This will allow Vector templating to work when using Kubernetes as the scheduler.
This commit is contained in:
Jose Diaz-Gonzalez
2025-08-23 15:46:57 -04:00
parent d4484d0373
commit 9c41bed78b
4 changed files with 62 additions and 0 deletions

View File

@@ -52,6 +52,37 @@ teardown_() {
assert_output "2"
}
@test "(scheduler-k3s) deploy kustomize with vector sink" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
INGRESS_CLASS=nginx install_k3s
encoded="$(echo '{{ print "{{ pod }}" }}' | base64)"
run /bin/bash -c "echo $encoded"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "e3sgcHJpbnQgInt7IHBvZCB9fSIgfX0K"
run /bin/bash -c "dokku logs:set --global vector-sink 'http://?process=base64enc%3A${encoded}'"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku scheduler-k3s:ensure-charts --charts vector"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "kubectl get cm -n vector vector -o yaml"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "process: '{{ pod }}'"
}
inject_kustomization_yaml() {
local APP="$1"
local APP_REPO_DIR="$2"