Skip to content

Commit

Permalink
log error details when error is encountered during bundle collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrokethecloud committed May 22, 2024
1 parent 5f66ca8 commit e38bdbe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/manager/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *Cluster) GenerateClusterBundle(bundleDir string) (string, error) {

errLog, err := os.Create(filepath.Join(bundleDir, "bundleGenerationError.log"))
if err != nil {
logrus.Errorf("Failed to create bundle generation log")
logrus.Errorf("Failed to create bundle generation log: %v", err)
return "", err
}
defer errLog.Close()
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/collectors/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (module clusterModule) generateYAMLs() {
objs, err := module.c.discovery.ResourcesForCluster(module.toObj, module.c.exclude, module.c.errorLog)

if err != nil {
logrus.Error("Unable to fetch cluster resources")
logrus.Errorf("Unable to fetch cluster resources: %v", err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/collectors/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (module defaultModule) generateDiscoveredNamespacedYAMLs(namespace string,
objs, err := module.c.discovery.ResourcesForNamespace(module.toObj, namespace, module.c.exclude, errLog)

if err != nil {
logrus.Error("Unable to fetch namespaced resources")
logrus.Errorf("Unable to fetch namespaced resources: %v", err)
return
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/collectors/harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (module harvesterModule) generateYAMLs() {
objs, err := module.c.discovery.SpecificResourcesForNamespace(module.toObj, module.name, namespace, resourceLists, module.c.errorLog)

if err != nil {
logrus.Error("Unable to fetch namespaced resources")
logrus.Errorf("Unable to fetch namespaced resources: %v", err)
return
}

Expand All @@ -48,7 +48,7 @@ func (module harvesterModule) generateYAMLs() {
objs, err := module.c.discovery.ResourcesForCluster(module.toClusterObj, module.skipClusterObjects, module.c.errorLog)

if err != nil {
logrus.Error("Unable to fetch cluster scoped resources")
logrus.Error("Unable to fetch cluster scoped resources: %v", err)
return
}

Expand Down

0 comments on commit e38bdbe

Please sign in to comment.