From ccf92e25aa13b0bed690d4319341c89947871a15 Mon Sep 17 00:00:00 2001 From: Todd Ritchie Date: Fri, 26 Nov 2021 11:40:42 -0500 Subject: [PATCH 1/2] fix typos in map_functions that would break service account fetching --- pkg/registrar/map_functions.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/registrar/map_functions.go b/pkg/registrar/map_functions.go index bcb039f4d..94d858abd 100644 --- a/pkg/registrar/map_functions.go +++ b/pkg/registrar/map_functions.go @@ -324,8 +324,8 @@ func (mapper *Mapper) RoleBindingToWorkloadRequests(roleBindingObject client.Obj if subject.APIGroup == "" && subject.Kind == "ServiceAccount" { serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil { @@ -349,8 +349,8 @@ func (mapper *Mapper) ClusterRoleBindingToWorkloadRequests(clusterRoleBindingObj if subject.APIGroup == "" && subject.Kind == "ServiceAccount" { serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil { @@ -489,8 +489,8 @@ func (mapper *Mapper) ClusterRoleBindingToDeliverableRequests(clusterRoleBinding if subject.APIGroup == "" && subject.Kind == "ServiceAccount" { serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil { @@ -605,8 +605,8 @@ func (mapper *Mapper) RoleBindingToRunnableRequests(roleBindingObject client.Obj serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil { @@ -630,8 +630,8 @@ func (mapper *Mapper) ClusterRoleBindingToRunnableRequests(clusterRoleBindingObj if subject.APIGroup == "" && subject.Kind == "ServiceAccount" { serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil { From d5c8b2b77b4f99606470a5548418c2b40ed7dcb3 Mon Sep 17 00:00:00 2001 From: Todd Ritchie Date: Fri, 26 Nov 2021 11:59:11 -0500 Subject: [PATCH 2/2] one more --- pkg/registrar/map_functions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/registrar/map_functions.go b/pkg/registrar/map_functions.go index 94d858abd..fe065f3b1 100644 --- a/pkg/registrar/map_functions.go +++ b/pkg/registrar/map_functions.go @@ -464,8 +464,8 @@ func (mapper *Mapper) RoleBindingToDeliverableRequests(roleBindingObject client. if subject.APIGroup == "" && subject.Kind == "ServiceAccount" { serviceAccountObject := &corev1.ServiceAccount{} serviceAccountKey := client.ObjectKey{ - Namespace: subject.Name, - Name: subject.Namespace, + Namespace: subject.Namespace, + Name: subject.Name, } err := mapper.Client.Get(context.TODO(), serviceAccountKey, serviceAccountObject) if err != nil {