From 7f2de9eb9dbcc4905df291b2a24dbeec192f48d7 Mon Sep 17 00:00:00 2001 From: tianfeiyu Date: Wed, 5 Aug 2020 17:49:28 +0800 Subject: [PATCH] fix: `kn source list` command print spelling problems (#963) --- pkg/kn/commands/source/list.go | 2 +- test/e2e/source_list_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/kn/commands/source/list.go b/pkg/kn/commands/source/list.go index 1f5cb3c15..ce29e9dc1 100644 --- a/pkg/kn/commands/source/list.go +++ b/pkg/kn/commands/source/list.go @@ -73,7 +73,7 @@ func NewListCommand(p *commands.KnParams) *cobra.Command { } if sourceList == nil || len(sourceList.Items) == 0 { - fmt.Fprintf(cmd.OutOrStdout(), "No sources found in %s namespace.\n", namespace) + fmt.Fprintf(cmd.OutOrStdout(), "No sources found.\n") return nil } // empty namespace indicates all namespaces flag is specified diff --git a/test/e2e/source_list_test.go b/test/e2e/source_list_test.go index 0d38b6baa..74b3336ec 100644 --- a/test/e2e/source_list_test.go +++ b/test/e2e/source_list_test.go @@ -64,7 +64,7 @@ func TestSourceList(t *testing.T) { t.Log("List sources empty case") output := sourceList(r) - assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) + assert.Check(t, util.ContainsAll(output, "No", "sources", "found.")) assert.Check(t, util.ContainsNone(output, "NAME", "TYPE", "RESOURCE", "SINK", "READY")) t.Log("Create API Server") @@ -86,9 +86,9 @@ func TestSourceList(t *testing.T) { t.Log("List sources filter invalid case") output = sourceList(r, "--type", "testapisource0") - assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) + assert.Check(t, util.ContainsAll(output, "No", "sources", "found.")) output = sourceList(r, "--type", "TestSource", "-oyaml") - assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) + assert.Check(t, util.ContainsAll(output, "No", "sources", "found.")) t.Log("List available source in YAML format") output = sourceList(r, "--type", "PingSource,ApiServerSource", "-oyaml")