Enable staticcheck and resolve found issues.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-25 11:27:27 +08:00
parent 1fd28e8a36
commit cb0ada1e1c
24 changed files with 51 additions and 45 deletions

View File

@@ -225,6 +225,10 @@ func (r *itemCollector) getResourceItems(log logrus.FieldLogger, gv schema.Group
},
).Infof("Getting item")
resourceClient, err := r.dynamicFactory.ClientForGroupVersionResource(gv, resource, resourceID.Namespace)
if err != nil {
log.WithError(errors.WithStack(err)).Error("Error getting client for resource")
continue
}
unstructured, err := resourceClient.Get(resourceID.Name, metav1.GetOptions{})
if err != nil {
log.WithError(errors.WithStack(err)).Error("Error getting item")