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: health status is set to healthy for statefulset with updateStrat… #136

Merged
merged 3 commits into from
Sep 1, 2020

Conversation

mayzhang2000
Copy link
Contributor

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2020

Codecov Report

Merging #136 into master will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   55.80%   55.73%   -0.07%     
==========================================
  Files          25       25              
  Lines        2724     2729       +5     
==========================================
+ Hits         1520     1521       +1     
- Misses       1065     1070       +5     
+ Partials      139      138       -1     
Impacted Files Coverage Δ
pkg/health/health.go 55.44% <100.00%> (-0.46%) ⬇️

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 8472746...f8a4cb4. Read the comment docs.

Copy link
Contributor

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

Please add unit test for stateful set with OnDelete strategy.

pkg/health/health.go Outdated Show resolved Hide resolved
@mayzhang2000
Copy link
Contributor Author

image

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 1, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.2% 2.2% Duplication

Copy link
Contributor

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@mayzhang2000 mayzhang2000 merged commit c9bb009 into argoproj:master Sep 1, 2020
if sts.Spec.UpdateStrategy.Type == appsv1.OnDeleteStatefulSetStrategyType {
return &HealthStatus{
Status: HealthStatusHealthy,
Message: fmt.Sprintf("statefulset has %d ready pods", sts.Status.ReadyReplicas),
Copy link

@glasser glasser May 10, 2024

Choose a reason for hiding this comment

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

I understand the issue that this change was fixing and it makes sense to me that this counts as "healthy", but what do folks think about iterating on this so that the message lets you know whether or not UpdatedReplicas matches Replicas in the OnDelete case?

Choose a reason for hiding this comment

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

glasser added a commit to glasser/gitops-engine that referenced this pull request May 10, 2024
…ealth message

Since argoproj#136 we've had the policy that an OnDelete statefulset is healthy as long as the statefulset spec is updated and the right number of pods are running, even if some of the pods are old and haven't been deleted yet. That's reasonable, but it still can be helpful to be able to see directly in the health message (and eg, in the ArgoCD UI) how many replicas have been updated. This adds that to the message.
glasser added a commit to glasser/gitops-engine that referenced this pull request May 10, 2024
…ealth message

Since argoproj#136 we've had the policy that an OnDelete statefulset is healthy as long as the statefulset spec is updated and the right number of pods are running, even if some of the pods are old and haven't been deleted yet. That's reasonable, but it still can be helpful to be able to see directly in the health message (and eg, in the ArgoCD UI) how many replicas have been updated. This adds that to the message.

Signed-off-by: David Glasser <[email protected]>
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.

StatefulSet with OnDelete Update Strategy stuck progressing
5 participants