Skip to content

Commit

Permalink
Error handling in cluster resources
Browse files Browse the repository at this point in the history
  • Loading branch information
marccampbell committed Sep 8, 2019
1 parent 4153b9a commit 0b7aff6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/collect/cluster_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ func ClusterResources(ctx *Context) ([]byte, error) {
clusterResourcesOutput := &ClusterResourcesOutput{}

// namespaces
namespaces, namespaceList, nsErrors := namespaces(client)
namespaces, namespaceList, namespaceErrors := namespaces(client)
clusterResourcesOutput.Namespaces = namespaces
clusterResourcesOutput.NamespacesErrors, err = marshalNonNil(nsErrors)
clusterResourcesOutput.NamespacesErrors, err = marshalNonNil(namespaceErrors)
if err != nil {
return nil, err
}

namespaceNames := make([]string, 0, 0)
for _, namespace := range namespaceList.Items {
namespaceNames = append(namespaceNames, namespace.Name)
if namespaceList != nil {
for _, namespace := range namespaceList.Items {
namespaceNames = append(namespaceNames, namespace.Name)
}
}

pods, podErrors := pods(client, namespaceNames)
Expand Down

0 comments on commit 0b7aff6

Please sign in to comment.