Skip to content

Commit 72acdf7

Browse files
committed
Merge pull request #523 from helgi/minio-from-api
ref(scheduler): fetch object storage credentials from API instead of local secret
2 parents e527d17 + 828c60b commit 72acdf7

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

rootfs/scheduler/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,14 +968,11 @@ def _healthcheck(self, controller, path='/', port=8080, delay=30, timeout=1):
968968
# http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_secret
969969

970970
def _create_minio_secret(self, namespace):
971-
with open("/var/run/secrets/deis/minio/user/access-key-id", "rb") as the_file:
972-
secretId = the_file.read()
973-
with open("/var/run/secrets/deis/minio/user/access-secret-key", "rb") as the_file:
974-
secretKey = the_file.read()
971+
secret = self._get_secret('deis', 'minio-user').json() # fetch from deis namespace
975972

976973
data = {
977-
'access-key-id': secretId,
978-
'access-secret-key': secretKey
974+
'access-key-id': base64.b64decode(secret['data']['access-key-id']),
975+
'access-secret-key': base64.b64decode(secret['data']['access-secret-key'])
979976
}
980977
self._create_secret(namespace, 'minio-user', data)
981978

0 commit comments

Comments
 (0)