ignore if appregistration cr is not present on cluster
@@ -145,14 +145,14 @@ func (r *ResourceCollector) GetResources(
var crdResources []metav1.GroupVersionKind
crdList, err := r.storkOps.ListApplicationRegistrations()
if err != nil {
- return nil, err
- }
+ logrus.Warnf("Unable to get registered crds, err %v", err)
+ } else {
for _, crd := range crdList.Items {
for _, kind := range crd.Resources {
crdResources = append(crdResources, kind.GroupVersionKind)
}
}
-
+ }
crbs, err := r.rbacOps.ListClusterRoleBindings()
if err != nil {
return nil, err
@@ -413,8 +413,8 @@ func (r *ResourceCollector) prepareResourcesForCollection(
content := o.UnstructuredContent()
crdList, err := r.storkOps.ListApplicationRegistrations()
if err != nil {
- return err
- }
+ logrus.Warnf("Unable to get registered crds, err %v", err)
+ } else {
resourceKind := o.GetObjectKind().GroupVersionKind()
for _, crd := range crdList.Items {
for _, kind := range crd.Resources {
@@ -427,6 +427,7 @@ func (r *ResourceCollector) prepareResourcesForCollection(
}
}
}
+ }
// remove metadata annotations
metadataMap := content["metadata"].(map[string]interface{})
// Remove all metadata except some well-known ones
