Skip to content

Commit

Permalink
[#504] CHanged a way to store crednetials in Secret. Now store a conn…
Browse files Browse the repository at this point in the history
…ections in separate keys
  • Loading branch information
aliaksandr-d committed Oct 16, 2018
1 parent 503ee8b commit ea78e68
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions legion_airflow/legion_airflow/hooks/k8s_base_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def _get_conn_from_k8s(cls, conn_id):
storage_name=cls.STORAGE_NAME_PREFIX,
k8s_namespace=os.environ['NAMESPACE']
)
connection_data = yaml.load(config_map.data['data'])
if conn_id not in connection_data.keys():
if conn_id not in config_map.data:
raise Exception("Doesn't have {} value in k8s secret".format(conn_id))
return Connection(**connection_data.get(conn_id))

connection_data = yaml.load(config_map.data[conn_id])
return Connection(**connection_data)

0 comments on commit ea78e68

Please sign in to comment.