Skip to content

Commit

Permalink
fixes 4240; added null check on namespace when resource is a RoleBinding
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Bilal committed Nov 27, 2021
1 parent 25ee506 commit b28f1e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/resmap/reswrangler.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ func getNamespacesForRoleBinding(r *resource.Resource) map[string]bool {
if ns, ok1 := subject["namespace"]; ok1 {
if kind, ok2 := subject["kind"]; ok2 {
if kind.(string) == "ServiceAccount" {
result[ns.(string)] = true
if n, ok3 := ns.(string); ok3 {
result[n] = true
}
}
}
}
Expand Down

0 comments on commit b28f1e5

Please sign in to comment.