From 5a04f3f8bec38bc4aaa06520d951aac2803af8e8 Mon Sep 17 00:00:00 2001
From: Tarun Pothulapati <tarun@gitpod.io>
Date: Wed, 17 Aug 2022 06:49:58 +0000
Subject: [PATCH] do encoding and decoding

Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
---
 install/kots/manifests/gitpod-installer-job.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/kots/manifests/gitpod-installer-job.yaml b/install/kots/manifests/gitpod-installer-job.yaml
index ae03d8841a7e9d..aba9efeae3d6bf 100644
--- a/install/kots/manifests/gitpod-installer-job.yaml
+++ b/install/kots/manifests/gitpod-installer-job.yaml
@@ -338,9 +338,9 @@ spec:
                   | base64 -d \
                   > /tmp/gitpodregistry.json
 
-
-                DOCKER_CONFIG='{{repl ConfigOptionData "reg_docker_config" }}'
-                export REGISTRY_SECRET=$(cat "${DOCKER_CONFIG}"  /tmp/gitpodregistry.json | jq -s '.[0] * .[1]' - - | base64 -w 0)
+                DOCKER_CONFIG='{{repl ConfigOptionData "reg_docker_config" | Base64Encode }}'
+                echo "${DOCKER_CONFIG}" | base64 -d  > /tmp/userregistry.json
+                export REGISTRY_SECRET=$(jq -s '.[0] * .[1]' /tmp/userregistry.json /tmp/gitpodregistry.json | base64 -w 0)
 
                 echo "Gitpod: update the in-cluster registry secret"
                 yq eval-all --inplace '(select(.kind == "Secret" and .metadata.name == "builtin-registry-auth") | .data.".dockerconfigjson") |= env(REGISTRY_SECRET)' \