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

feat(kubectl rollout): support multiple resources for rollout status #108777

Merged
merged 2 commits into from May 13, 2022

Conversation

pjo256
Copy link
Contributor

@pjo256 pjo256 commented Mar 17, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support for multiple resources in kubectl rollout status (including -R),e.g.

minikube-example ../kubernetes/_output/bin/kubectl rollout status -f deployments                                                                                                 (minikube/default)
deployment "example1" successfully rolled out
deployment "example2" successfully rolled out

where before this would fail with

error: rollout status is only supported on individual resources and resource

Which issue(s) this PR fixes:

Fixes #72216

Special notes for your reviewer:

This is my first k8s PR - should I add unit tests for kubectl rollout status in https://github.com/kubernetes/kubernetes/blob/master/test/cmd/generic-resources.sh#L359? Noticed we don't have any coverage there.

Does this PR introduce a user-facing change?

kubectl: support multiple resources for kubectl rollout status

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 17, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 17, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: pjo256 / name: Philip Ottesen (cda4c3c1b505e2c1ed697e4fecae2a073381f770)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 17, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @pjo256!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 17, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @pjo256. Thanks for your PR.

I'm waiting for a kubernetes 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.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 17, 2022
@pjo256
Copy link
Contributor Author

pjo256 commented Mar 17, 2022

/sig cli

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. area/kubectl and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 17, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 18, 2022
@pjo256
Copy link
Contributor Author

pjo256 commented Apr 1, 2022

/assign @eddiezane

@pjo256
Copy link
Contributor Author

pjo256 commented Apr 6, 2022

@eddiezane Any chance you'd be able to take a look?

@pjo256 pjo256 changed the title kubectl rollout: support recursive flag for rollout status kubectl rollout: support multiple resources for rollout status Apr 18, 2022
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Apr 18, 2022
@eddiezane
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 21, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 21, 2022
@pjo256 pjo256 changed the title kubectl rollout: support multiple resources for rollout status feat(kubectl rollout): support multiple resources for rollout status May 6, 2022
@@ -168,73 +168,67 @@ func (o *RolloutStatusOptions) Run() error {
LabelSelectorParam(o.LabelSelector).
FilenameParam(o.EnforceNamespace, o.FilenameOptions).
ResourceTypeOrNameArgs(true, o.BuilderArgs...).
SingleResourceType().
ContinueOnError().
Copy link
Member

Choose a reason for hiding this comment

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

Could you please elaborate what will happen if one of resources get error like in here https://github.com/kubernetes/kubernetes/pull/108777/files#diff-484e3b9bfad2141dd92637f42b9d227b2d7e91d0932bb85ec7cf098c20770691R394-R396.

Do resources, whose are not getting any error, stay in waiting stage? or we exit immediately?

Copy link
Contributor Author

@pjo256 pjo256 May 9, 2022

Choose a reason for hiding this comment

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

We run against every visited resource as opposed to exiting immediately on the first error, e.g.

_output/bin/kubectl rollout status -f . -R --timeout=10s 
deployment "echoserver-1" successfully rolled out
Waiting for deployment "echoserver-2" rollout to finish: 0 of 1 updated replicas are available...
deployment "echoserver-3" successfully rolled out
error: timed out waiting for the condition

While looking into other rollout commands, this looks consistent but I noticed these commands (pause, resume, history) have a Flatten() call prior to Do(). Do we want that call here for nested manifests?

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/triage accepted
/priority backlog
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 13, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pjo256, soltysh

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 /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 May 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 47bb8c6 into kubernetes:master May 13, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone May 13, 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. area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl rollout status should support multiple resources
5 participants