Skip to content

add filtering and listing functionalities#605

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
chunglu-chou:migrate
Aug 22, 2022
Merged

add filtering and listing functionalities#605
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
chunglu-chou:migrate

Conversation

@chunglu-chou
Copy link
Copy Markdown
Contributor

Add filter options on inventory names, namespaces, and statuses.
Add functions for retrieving a list of live inventory objects from the cluster.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 19, 2022
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 19, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 19, 2022
@mortent
Copy link
Copy Markdown
Member

mortent commented Aug 20, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 20, 2022
@chunglu-chou chunglu-chou force-pushed the migrate branch 4 times, most recently from 24f3b94 to 097a477 Compare August 20, 2022 22:27
Copy link
Copy Markdown
Member

@mortent mortent left a 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.

import (
"context"
"fmt"
ss "strings"
Copy link
Copy Markdown
Member

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

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",
Copy link
Copy Markdown
Member

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

switch r.invType {
case Local:
if len(args) != 0 {
fmt.Printf("%c[%dm", printcommon.ESC, printcommon.YELLOW)
Copy link
Copy Markdown
Member

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:

func SprintfWithColor(color Color, format string, a ...interface{}) string {

Copy link
Copy Markdown
Member

@mortent mortent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 22, 2022
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2022
@k8s-ci-robot k8s-ci-robot merged commit c10935a into kubernetes-sigs:master Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants