@@ -377,24 +377,23 @@ def delete_role_binding(self, role_binding: RoleBinding):
377377 f"Exception deleting role { role_binding .role .name } : { e } \n "
378378 )
379379
380- def create_role_binding (self , name : str , subjects : [Subject ], role : Role ):
380+ def create_role_binding (self , name : str , subjects : list [Subject ], role : Role ):
381381 if self .is_role_binding_created (name = name ):
382382 return self .rbac_authorization_v1_api .read_namespaced_role_binding (
383383 name = name , namespace = self .namespace
384384 )
385385
386386 metadata = client .V1ObjectMeta (name = name , namespace = self .namespace )
387387
388- role_ref = client .V1RoleRef (api_group = "" , kind = "Role" , name = role .name )
388+ role_ref = client .V1RoleRef (api_group = "rbac.authorization.k8s.io " , kind = "Role" , name = role .name )
389389
390390 subject_list = []
391391 for subject in subjects :
392- subject = client .models .V1Subject (
393- api_group = "" ,
394- kind = subject .kind .value ,
395- name = subject .name ,
396- namespace = self .namespace ,
397- )
392+ subject = {
393+ "kind" : subject .kind .value ,
394+ "name" : subject .name ,
395+ "namespace" : self .namespace ,
396+ }
398397 subject_list .append (subject )
399398
400399 body = client .V1RoleBinding (
@@ -1024,7 +1023,7 @@ def initialise(self):
10241023 )
10251024 self .spawner .log .info (f"env_from_secrets { env_from_secrets } " )
10261025 if env_from_secrets :
1027- if self .spawner .extra_container_config [ "env_from" ] is None :
1026+ if self .spawner .extra_container_config . get ( "env_from" ) is None :
10281027 self .spawner .extra_container_config ["env_from" ] = []
10291028
10301029 for env_from_secret in env_from_secrets :
0 commit comments