From d62951e39ebfd455b7419676e666bceaffa06dc6 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 18 Nov 2022 11:12:35 +0100 Subject: [PATCH] refactor: using stringData field to setup secret This makes the code simpler and lets k8s encode the data --- binderhub/build.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/binderhub/build.py b/binderhub/build.py index a48c6eca13..a215f79f87 100644 --- a/binderhub/build.py +++ b/binderhub/build.py @@ -2,7 +2,6 @@ Contains build of a docker image from a git repository. """ -import base64 import datetime import json import os @@ -383,13 +382,8 @@ def submit(self): env = [] if self.git_credentials: - secret_content = base64.b64encode( - self.git_credentials.encode("utf-8") - ).decode("utf-8") - data = {"credentials": secret_content} - secret = client.V1Secret() - secret.data = data + secret.string_data = {"credentials": self.git_credentials} secret.metadata = {"name": self.name} secret.type = "Opaque"