mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-27 20:03:52 +00:00
add flag --no-headers to kubectl top ...
This commit is contained in:
@@ -81,6 +81,7 @@ func TestTopNodeAllMetrics(t *testing.T) {
|
||||
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
||||
|
||||
cmd := NewCmdTopNode(tf, nil, streams)
|
||||
cmd.Flags().Set("no-headers", "true")
|
||||
cmd.Run(cmd, []string{})
|
||||
|
||||
// Check the presence of node names in the output.
|
||||
@@ -90,6 +91,9 @@ func TestTopNodeAllMetrics(t *testing.T) {
|
||||
t.Errorf("missing metrics for %s: \n%s", m.Name, result)
|
||||
}
|
||||
}
|
||||
if strings.Contains(result, "MEMORY") {
|
||||
t.Errorf("should not print headers with --no-headers option set:\n%s\n", result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTopNodeAllMetricsCustomDefaults(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user