Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vmware-tanzu#151 from timothysc/Node_bug
Browse files Browse the repository at this point in the history
Fix bug caused by cleanup on node collection.
Signed-off-by: Jesse Hamilton jesse.hamilton@heptio.com
timothysc authored Nov 17, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 9ca5534 + 0e3db81 commit 654cd53
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pkg/discovery/queries.go
Original file line number Diff line number Diff line change
@@ -281,17 +281,6 @@ func QueryClusterResources(kubeClient kubernetes.Interface, recorder *QueryRecor
// 2. Execute the non-ns-query
for _, resourceKind := range resources {
switch resourceKind {
case "Nodes":
// cfg.Nodes configures whether users want to gather the Nodes resource in the
// cluster, but we also use that option to guide whether we get node data such
// as configz and healthz endpoints.

// NOTE: Node data collection is an aggregated time b/c propagating that detail back up
// is odd and would pollute some of the output.
start := time.Now()
err := gatherNodeData(kubeClient, cfg)
duration := time.Since(start)
recorder.RecordQuery("Nodes", "", duration, err)
case "ServerVersion":
objqry := func() (interface{}, error) { return kubeClient.Discovery().ServerVersion() }
query := func() (time.Duration, error) {
@@ -304,6 +293,18 @@ func QueryClusterResources(kubeClient kubernetes.Interface, recorder *QueryRecor
return untypedQuery(cfg.OutputDir(), "servergroups.json", objqry)
}
timedQuery(recorder, "servergroups", "", query)
case "Nodes":
// cfg.Nodes configures whether users want to gather the Nodes resource in the
// cluster, but we also use that option to guide whether we get node data such
// as configz and healthz endpoints.

// NOTE: Node data collection is an aggregated time b/c propagating that detail back up
// is odd and would pollute some of the output.
start := time.Now()
err := gatherNodeData(kubeClient, cfg)
duration := time.Since(start)
recorder.RecordQuery("Nodes", "", duration, err)
fallthrough
default:
lister := func() (runtime.Object, error) { return queryNonNsResource(resourceKind, kubeClient) }
query := func() (time.Duration, error) { return objListQuery(outdir+"/", resourceKind+".json", lister) }

0 comments on commit 654cd53

Please sign in to comment.