Skip to content
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

Enhance for loops of ViewHistorys #83984

Closed
whs-dot-hk opened this issue Oct 16, 2019 · 11 comments
Closed

Enhance for loops of ViewHistorys #83984

whs-dot-hk opened this issue Oct 16, 2019 · 11 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@whs-dot-hk
Copy link

What would you like to be added:

When revision > 0
we could break out of the for loop
once we got the info

Why is this needed:
Finish faster

/sig cli

@whs-dot-hk whs-dot-hk added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 16, 2019
@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Oct 16, 2019
@ZP-AlwaysWin
Copy link
Contributor

ZP-AlwaysWin commented Oct 17, 2019

I don't quite understand what you mean. The reason for the loop is that even if revision > 0, it should need to traverse the history details.

@whs-dot-hk
Copy link
Author

Hi, I mean

for all rs
  v is the revision return from deploymentutil.Revision
  // keep the logic
  if revision supplied in argument > 0 and v == revision
    break
  endif
endfor

@zhouya0
Copy link
Contributor

zhouya0 commented Oct 17, 2019

I think it's ok to do break for the loop. Because the the function will return the specfic info when revision >0.

if revision > 0 {
// Print details of a specific revision
template, ok := historyInfo[revision]
if !ok {
return "", fmt.Errorf("unable to find the specified revision")
}
return printTemplate(template)
}

@ZP-AlwaysWin
Copy link
Contributor

It seems like a good idea. You can try to optimize it.

@whs-dot-hk
Copy link
Author

/assign

@whs-dot-hk
Copy link
Author

It seems like a good idea. You can try to optimize it.

Thx

@whs-dot-hk
Copy link
Author

Hi, done

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 15, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants