Skip to content

Commit 5349e97

Browse files
authored
Fix for ClusterRoleBinding without a 'subjects' field
ClusterRoleBindings should have the field `subjects`. But it is possible to create ClusterRoleBinding wihtout `subjects` field such as the default ClusterRoleBinding `system:node` from kubeadm installlation or by Minikube. The code didn't verified it the `subjects` field exist and therefore throw an exception. The fix now verify the this field exist before checking it.
1 parent ba5b59c commit 5349e97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/api_client_temp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def list_cluster_role_binding(self):
648648
role_ref = V1RoleRef(api_group=i['roleRef']['apiGroup'], name=i['roleRef']['name'], kind=i['roleRef']['kind'])
649649
subjects = []
650650

651-
if i['subjects'] is not None:
651+
if 'subjects' in i and i['subjects'] is not None:
652652
for s in i['subjects']:
653653
namespace = None
654654
if 'namespace' in s.keys():

0 commit comments

Comments
 (0)