-
Notifications
You must be signed in to change notification settings - Fork 78
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
add filtering and listing functionalities #605
Conversation
Hi @chunglu-chou. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
24f3b94
to
097a477
Compare
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.
Just a few small comments, but overall looks good.
cmd/status/cmdstatus.go
Outdated
@@ -6,11 +6,13 @@ package status | |||
import ( | |||
"context" | |||
"fmt" | |||
ss "strings" |
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.
Lets avoid aliasing the go libraries. If there is a conflict, use an alias for the other library
cmd/status/cmdstatus.go
Outdated
func (r *Runner) runE(cmd *cobra.Command, args []string) error { | ||
func (r *Runner) preRunE(*cobra.Command, []string) error { | ||
if !slice.ContainsString(PollUntilOptions, r.pollUntil, nil) { | ||
return fmt.Errorf("pollUntil must be one of %s, %s, %s, %s", |
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.
Nit: I think it would be easier to just use strings.Join(PollUntilOptions, ",")
here
cmd/status/cmdstatus.go
Outdated
switch r.invType { | ||
case Local: | ||
if len(args) != 0 { | ||
fmt.Printf("%c[%dm", printcommon.ESC, printcommon.YELLOW) |
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 think you can simplify this with:
cli-utils/pkg/print/common/color.go
Line 25 in eb8ebd7
func SprintfWithColor(color Color, format string, a ...interface{}) string { |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chunglu-chou, mortent 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 filter options on inventory names, namespaces, and statuses.
Add functions for retrieving a list of live inventory objects from the cluster.