Skip to content

Commit

Permalink
refactor: using stringData field to setup secret
Browse files Browse the repository at this point in the history
This makes the code simpler and lets k8s encode the data
  • Loading branch information
sgaist committed Nov 18, 2022
1 parent eb0d9ee commit d62951e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions binderhub/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Contains build of a docker image from a git repository.
"""

import base64
import datetime
import json
import os
Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit d62951e

Please sign in to comment.