From a86510bd0252410b385c1e3b422e55a09fb9d263 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 23 Mar 2020 13:01:46 -0500 Subject: [PATCH] Trim whitespace from uri password for docker promote The uri module faithfully passes the entire string, even if it has trailing whitespace such as a newline. The zuul encrypt_secret command currently does not trim, so if echo was used instead of echo -n this can fail in a hard to debug manner. Change-Id: Ic9525ac2925b6639f58604ca40dc878d20511ff8 --- roles/promote-docker-image/tasks/promote-retag.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/promote-docker-image/tasks/promote-retag.yaml b/roles/promote-docker-image/tasks/promote-retag.yaml index 8237dab4c..043cfbb91 100644 --- a/roles/promote-docker-image/tasks/promote-retag.yaml +++ b/roles/promote-docker-image/tasks/promote-retag.yaml @@ -3,7 +3,7 @@ uri: url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:{{ image.repository }}:pull,push" user: "{{ docker_credentials.username }}" - password: "{{ docker_credentials.password }}" + password: "{{ docker_credentials.password | trim }}" force_basic_auth: true register: token - name: Retag image