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

fix: rollout status always in progressing if analysis fails #1099

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

huikang
Copy link
Member

@huikang huikang commented Apr 21, 2021

  • when analysis fails but rollout completes, the status should
    be degraded

address #942

@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #1099 (800145a) into master (734c859) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1099   +/-   ##
=======================================
  Coverage   81.24%   81.24%           
=======================================
  Files         104      104           
  Lines        9420     9420           
=======================================
  Hits         7653     7653           
  Misses       1257     1257           
  Partials      510      510           
Impacted Files Coverage Δ
rollout/sync.go 75.25% <100.00%> (ø)

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 734c859...800145a. Read the comment docs.

- when analysis fails but rollout completes, the status should
be degraded

Signed-off-by: Hui Kang <hui.kang@salesforce.com>
@huikang huikang force-pushed the fix-degraded-status branch 4 times, most recently from b161324 to 2d087c9 Compare April 21, 2021 17:18
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
@sonarcloud
Copy link

sonarcloud bot commented Apr 21, 2021

Kudos, SonarCloud Quality Gate passed!

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

No Coverage information No Coverage information
7.3% 7.3% Duplication

@jessesuen jessesuen requested a review from khhirani April 21, 2021 19:04
Copy link
Contributor

@khhirani khhirani left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -585,7 +585,7 @@ func (c *rolloutContext) calculateRolloutConditions(newStatus v1alpha1.RolloutSt
// In such a case, we should simply not estimate any progress for this rollout.
currentCond := conditions.GetRolloutCondition(c.rollout.Status, v1alpha1.RolloutProgressing)

isCompleteRollout := newStatus.Replicas == newStatus.AvailableReplicas && currentCond != nil && currentCond.Reason == conditions.NewRSAvailableReason
isCompleteRollout := newStatus.Replicas == newStatus.AvailableReplicas && currentCond != nil && currentCond.Reason == conditions.NewRSAvailableReason && currentCond.Type != v1alpha1.RolloutProgressing
Copy link
Member

Choose a reason for hiding this comment

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

I just reviewed the calculateRolloutConditions to learn what's going on inside and found one interesting place where I'm a little bit confused:

The next expression currentCond.Type != v1alpha1.RolloutProgressing will always be false as the currentCond is a condition filtered by the v1alpha1.RolloutProgressing type.

That means isCompleteRollout is always false. Maybe we will remove it?

@jessesuen @huikang Please correct me here if I'm wrong.

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.

None yet

3 participants