Skip to content

Commit f64c9a7

Browse files
authored
Merge pull request #818 from jbiers/backport-globalrolebinding-fix
[release/v7.x] Drop GlobalRoleBinding OwnerRefs
2 parents 51710e1 + 07dfc6d commit f64c9a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/controllers/restore/controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,14 @@ func (h *handler) generateDependencyGraph(ownerToDependentsList map[string][]res
453453
continue
454454
}
455455

456+
// This behavior is needed as BRO ignores all builtin GlobalRoles and RoleTemplates which would lead to all their child resources
457+
// not beind properly created on migrations if they kept waiting for their Owners to be created.
458+
if strings.EqualFold(kind, "globalrole") || strings.EqualFold(kind, "roletemplate") {
459+
errCheckingOwnerRefs = true
460+
logrus.Infof("Resource %v of type %v has %v as owner. The OwnerRefs will be dropped.", name, gvr.String(), gvk.String())
461+
continue
462+
}
463+
456464
var apiGroup, version string
457465
split := strings.SplitN(groupVersion, "/", 2)
458466
if len(split) == 1 {

0 commit comments

Comments
 (0)