mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
fixes 4240; added null check on namespace when resource is a RoleBinding
This commit is contained in:
@@ -436,7 +436,9 @@ func getNamespacesForRoleBinding(r *resource.Resource) map[string]bool {
|
|||||||
if ns, ok1 := subject["namespace"]; ok1 {
|
if ns, ok1 := subject["namespace"]; ok1 {
|
||||||
if kind, ok2 := subject["kind"]; ok2 {
|
if kind, ok2 := subject["kind"]; ok2 {
|
||||||
if kind.(string) == "ServiceAccount" {
|
if kind.(string) == "ServiceAccount" {
|
||||||
result[ns.(string)] = true
|
if n, ok3 := ns.(string); ok3 {
|
||||||
|
result[n] = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user