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: Implement rollout status command. Fixes #596 #1001

Merged
merged 11 commits into from
Mar 24, 2021
Merged

feat: Implement rollout status command. Fixes #596 #1001

merged 11 commits into from
Mar 24, 2021

Conversation

ThisIsFroggie
Copy link
Contributor

@ThisIsFroggie ThisIsFroggie commented Feb 22, 2021

Closes #596

This replicates the kubectl rollout status deployment [--watch] <name> command, but for Rollouts.

This is implemented as:

# Returns Rollout status: Healthy, Progressing, Degraded, etc
kubectl argo rollouts status --watch=false <name>

# Waits until status is Healthy or Degraded (default behaviour without flags)
kubectl argo rollouts status --watch <name>

The flags and defaults for them replicate the kubectl rollout status deployment <name> command. As in it, --watch is default and the default timeout is 5 minutes.


Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@ThisIsFroggie ThisIsFroggie changed the title Implement rollout status command feat:Implement rollout status command Feb 22, 2021
@ThisIsFroggie ThisIsFroggie changed the title feat:Implement rollout status command feat: Implement rollout status command Feb 22, 2021
@ThisIsFroggie ThisIsFroggie changed the title feat: Implement rollout status command feat: Implement rollout status command. Fixes #596 Feb 23, 2021
@codecov-io
Copy link

codecov-io commented Feb 25, 2021

Codecov Report

Merging #1001 (3f754e8) into master (dff1f22) will increase coverage by 0.09%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1001      +/-   ##
==========================================
+ Coverage   80.90%   81.00%   +0.09%     
==========================================
  Files         102      103       +1     
  Lines        9080     9159      +79     
==========================================
+ Hits         7346     7419      +73     
- Misses       1240     1245       +5     
- Partials      494      495       +1     
Impacted Files Coverage Δ
pkg/kubectl-argo-rollouts/cmd/status/status.go 93.44% <93.44%> (ø)
pkg/kubectl-argo-rollouts/cmd/cmd.go 100.00% <100.00%> (ø)
utils/evaluate/evaluate.go 60.74% <0.00%> (-0.73%) ⬇️
pkg/kubectl-argo-rollouts/cmd/create/create.go 65.42% <0.00%> (-0.60%) ⬇️
metricproviders/wavefront/wavefront.go 95.45% <0.00%> (-0.06%) ⬇️
analysis/analysis.go 83.80% <0.00%> (+0.09%) ⬆️
.../apis/rollouts/validation/validation_references.go 74.28% <0.00%> (+1.01%) ⬆️
rollout/service.go 78.94% <0.00%> (+4.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dff1f22...3f754e8. Read the comment docs.

@ThisIsFroggie ThisIsFroggie marked this pull request as ready for review February 25, 2021 15:23
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
@ThisIsFroggie ThisIsFroggie requested a review from jsoref March 1, 2021 11:31
Copy link
Member

@jsoref jsoref left a comment

Choose a reason for hiding this comment

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

With this, I think this is the best I can offer as feedback. Someone more core should be responsible for a code review & approval

pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
pkg/kubectl-argo-rollouts/cmd/status/status.go Outdated Show resolved Hide resolved
Pedro Arvela added 10 commits March 2, 2021 10:42
Signed-off-by: Pedro Arvela <[email protected]>
Signed-off-by: Pedro Arvela <[email protected]>
Signed-off-by: Pedro Arvela <[email protected]>
Signed-off-by: Pedro Arvela <[email protected]>
Signed-off-by: Pedro Arvela <[email protected]>
Signed-off-by: Pedro Arvela <[email protected]>
@keithmattix
Copy link
Contributor

keithmattix commented Mar 16, 2021

Is there anything preventing this from being merged? This would be huge for my organization's CD pipeline

@jessesuen
Copy link
Member

The flags and defaults for them replicate the kubectl rollout status deployment command. As in it, --watch is default and the default timeout is 5 minutes.

It seems that kubectl defaults to at timeout of 0s (never). Instead of defaulting to 5m, can we replicate kubectl behavior?

$ kubectl rollout status --help
...
      --timeout=0s: The length of time to wait before ending watch, zero means never. Any other values should contain a
corresponding time unit (e.g. 1s, 2m, 3h).

@ThisIsFroggie
Copy link
Contributor Author

It seems that kubectl defaults to at timeout of 0s (never). Instead of defaulting to 5m, can we replicate kubectl behavior?

I must have misread when I saw the timeout default. I'll update it to replicate that default.

@sonarcloud
Copy link

sonarcloud bot commented Mar 22, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
16.8% 16.8% Duplication

@ThisIsFroggie
Copy link
Contributor Author

Fixed the timeout to match the official one in kubectl itself.

@jessesuen jessesuen merged commit 92c1b16 into argoproj:master Mar 24, 2021
@jessesuen
Copy link
Member

Great work!

@shahafy-ma
Copy link

When will it be available for use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] rollout status
6 participants