Repository: knative/client (go)

Issue:
Missing NAMESPACE column header for 'kn source list -A'
### Bug report
column header NAMESPACE is not printed for `kn source list -A` output.

```
kn source list -A
NAME   TYPE      RESOURCE     SINK                              READY
test   my-ping   PingSource   pingsources.sources.knative.dev   ksvc:event-display   True
```

### Expected behavior
column header NAMESPACE should be printed for `kn source list -A` output.


### Steps to reproduce the problem
1 - create some sources
2 -  run `kn source list -A`

### kn version
master

Pull request description:
Fix missing NAMESPACE column header
## Description

<!-- Please add a short summary about what the pull request is going to bring on the table -->
Fix for Missing NAMESPACE column header for 'kn source list -A'


## Reference

<!-- Please add the corresponding issue number which this pull request is about to fix -->
Fixes #946 

<!--
Please add an entrty to CHANGELOG.adoc file, too, as part of your Pull Request.

In the following cases, add a short description of PR to the unreleased section in CHANGELOG.adoc:

- 🎁 New feature
- 🐛 Bug fix
- ✨ Feature Update
- 🐣 Refactoring
- 🗑️ Remove feature or internal logic

See other entries in CHANGELOG.adoc as an example for how to add the entry, including a reference to the corresponding issue/PR

PLEASE DON'T ADD THAT LINE HERE IN THE PULL-REQUEST DESCRIPTION BUT DIRECTLY IN CHANGELOG.ADOC AND ADD CHANGELOG.ADOC AS PART OF YOUR PULL-REQUEST.
-->

<!--
To automatically lint go code in this pull request uncomment the line below. You get feedback as comments on your pull request then -->

<!--
/lint
-->


Patch:
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 4fbaeb8e..1c681980 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -22,6 +22,10 @@
 | Add support to combine service create --filename with other options
 | https://github.com/knative/client/pull/937[#937]
 
+| 🎁
+| Fix Missing NAMESPACE column header for 'kn source list -A'
+| https://github.com/knative/client/pull/951[#951]
+
 |===
 
 ## v0.16.0 (2020-07-14)
diff --git a/pkg/kn/commands/source/human_readable_flags.go b/pkg/kn/commands/source/human_readable_flags.go
index 2357c88d..1e74af0a 100644
--- a/pkg/kn/commands/source/human_readable_flags.go
+++ b/pkg/kn/commands/source/human_readable_flags.go
@@ -47,6 +47,7 @@ func ListTypesHandlers(h printers.PrintHandler) {
 // ListHandlers handles printing human readable table for `kn source list`
 func ListHandlers(h printers.PrintHandler) {
 	sourceListColumnDefinitions := []metav1beta1.TableColumnDefinition{
+		{Name: "Namespace", Type: "string", Description: "Namespace of the source", Priority: 0},
 		{Name: "Name", Type: "string", Description: "Name of the created source", Priority: 1},
 		{Name: "Type", Type: "string", Description: "Type of the source", Priority: 1},
 		{Name: "Resource", Type: "string", Description: "Source type name", Priority: 1},


Test patch:
diff --git a/pkg/kn/commands/source/list_test.go b/pkg/kn/commands/source/list_test.go
index 170be23a..71541d4d 100644
--- a/pkg/kn/commands/source/list_test.go
+++ b/pkg/kn/commands/source/list_test.go
@@ -160,3 +160,19 @@ func newSourceUnstructuredObj(name, apiVersion, kind string) *unstructured.Unstr
 		},
 	}
 }
+
+func TestSourceListAllNamespace(t *testing.T) {
+	output, err := sourceFakeCmd([]string{"source", "list", "--all-namespaces"},
+		newSourceCRDObjWithSpec("pingsources", "sources.knative.dev", "v1alpha1", "PingSource"),
+		newSourceCRDObjWithSpec("sinkbindings", "sources.knative.dev", "v1alpha1", "SinkBinding"),
+		newSourceCRDObjWithSpec("apiserversources", "sources.knative.dev", "v1alpha1", "ApiServerSource"),
+		newSourceUnstructuredObj("p1", "sources.knative.dev/v1alpha1", "PingSource"),
+		newSourceUnstructuredObj("s1", "sources.knative.dev/v1alpha1", "SinkBinding"),
+		newSourceUnstructuredObj("a1", "sources.knative.dev/v1alpha1", "ApiServerSource"),
+	)
+	assert.NilError(t, err)
+	assert.Check(t, util.ContainsAll(output[0], "NAMESPACE", "NAME", "TYPE", "RESOURCE", "SINK", "READY"))
+	assert.Check(t, util.ContainsAll(output[1], "current", "a1", "ApiServerSource", "apiserversources.sources.knative.dev", "ksvc:foo", "True"))
+	assert.Check(t, util.ContainsAll(output[2], "current", "p1", "PingSource", "pingsources.sources.knative.dev", "ksvc:foo", "True"))
+	assert.Check(t, util.ContainsAll(output[3], "current", "s1", "SinkBinding", "sinkbindings.sources.knative.dev", "ksvc:foo", "True"))
+}