Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fix(secret): handle the secret value if it is None
Browse files Browse the repository at this point in the history
  • Loading branch information
kmala committed Aug 3, 2016
1 parent 4d75eef commit 8de5f6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rootfs/scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,9 @@ def get_secret(self, namespace, name):
# decode the base64 data
secrets = response.json()
for key, value in secrets['data'].items():
if value is None:
secrets['data'][key] = ""
continue
value = base64.b64decode(value)
value = value if isinstance(value, bytes) else bytes(value, 'UTF-8')
secrets['data'][key] = value.decode(encoding='UTF-8')
Expand Down

0 comments on commit 8de5f6c

Please sign in to comment.