Skip to content

Commit

Permalink
Fix for migtools#150: initialized filteredClusterRoleBindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmartinol committed Mar 7, 2023
1 parent b0b8c80 commit 7f58578
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/export/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
authv1 "github.com/openshift/api/authorization/v1"
securityv1 "github.com/openshift/api/security/v1"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down Expand Up @@ -106,6 +107,14 @@ func (c *ClusterScopedRbacHandler) prepareForFiltering() {
}
}
c.filteredClusterRoleBindings.objects = &filteredClusterRoleBindings
} else {
c.filteredClusterRoleBindings = &groupResource{
APIGroup: "NA",
APIVersion: "NA",
APIGroupVersion: "NA",
APIResource: metav1.APIResource{},
}
c.filteredClusterRoleBindings.objects = &unstructured.UnstructuredList{Items: []unstructured.Unstructured{}}
}
}

Expand Down

0 comments on commit 7f58578

Please sign in to comment.