diff --git a/deploy/helms/airflow/templates/worker-rbac.yaml b/deploy/helms/airflow/templates/worker-rbac.yaml index 4419fbfbc..5c9dbbf33 100644 --- a/deploy/helms/airflow/templates/worker-rbac.yaml +++ b/deploy/helms/airflow/templates/worker-rbac.yaml @@ -9,7 +9,7 @@ rules: - apiGroups: [""] # core API group resources: ["secrets"] verbs: ["watch", "get"] - resourceNames: ['airflow-credentials-*'] + resourceNames: ['airflow-credentials'] --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 diff --git a/legion_airflow/legion_airflow/hooks/k8s_base_hook.py b/legion_airflow/legion_airflow/hooks/k8s_base_hook.py index c803d1f4d..5cb03a2ec 100644 --- a/legion_airflow/legion_airflow/hooks/k8s_base_hook.py +++ b/legion_airflow/legion_airflow/hooks/k8s_base_hook.py @@ -52,6 +52,6 @@ def _get_conn_from_k8s(cls, conn_id): k8s_namespace=os.environ['NAMESPACE'] ) connection_data = yaml.load(config_map.data['data']) - if conn_id not in connection_data.values(): + if conn_id not in connection_data.keys(): raise Exception("Doesn't have {} value in k8s secret".format(conn_id)) return Connection(**connection_data.get(conn_id))