New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support --all-namespaces option for service and revision list #32
Conversation
@nak3 we should probably move this into KnParams or some other object (like NamespaceParams) that's injecting; otherwise, we would have to duplicate this functionality everywhere. |
@cppforlife Thank you! Updated by adding the option into KnParams and adding the flag to revision,service command instead of list only. |
pkg/kn/commands/revision.go
Outdated
@@ -24,6 +24,9 @@ func NewRevisionCommand(p *KnParams) *cobra.Command { | |||
Short: "Revision command group", | |||
} | |||
revisionCmd.PersistentFlags().StringP("namespace", "n", "default", "Namespace to use.") | |||
revisionCmd.PersistentFlags().BoolVar(&p.getAllNamespaces, "all-namespaces", false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we also share following 3 lines as well between commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that --all-namespace
should move to root level option like --config
and --kubeconfig
?
I put --all-namespace
here to align with --namespace
(-n
). Should I share --namespace
between commands as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nak3 probably not global, but doesnt mean we cannot reuse this code so that we dont have duplicate flag definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see an AddNamespaceFlags fn and a GetNamespace(cmd) fn.
@cppforlife @sixolet Thank you! Updated. |
+1 for @navidshaikh suggestions |
Thank you, updated the help messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/ok-to-test |
Kicking these tests since a fix for these CI failures has since been merged. /retest |
rebased to solve confliction. |
/lgtm |
/test pull-knative-client-unit-tests |
The test was failed at TestServiceCreateImage. It looks like I need to rebase this PR again(?) Let's see the result of secod try.
|
`kn {service, revision} list` does not have the all-namespaces options. Although it is possible to list them by `kn service list -n ""`(empty string), it is difficult to find such secret trick. Hence, This patch adds `--all-namespaces` option.
The following is the coverage report on pkg/.
|
@cppforlife @cppforlife @bbrowning @navidshaikh |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cppforlife, nak3, navidshaikh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add missing jobs, group similar tasks, update settings.
Currently
kn {service, revision} list
does not have the all-namespacesoptions. Although it is possible to list them by
kn service list -n ""
(empty string), it is difficult to find such secret trick.Hence, this patch adds
--all-namespaces
option.