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: init cluster health default status to green avoid nil panic #81

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

luohf-infinilabs
Copy link
Contributor

@luohf-infinilabs luohf-infinilabs commented Feb 13, 2025

What does this PR do

This pull request includes a small change to the core/elastic/actions.go file. The change ensures that when the Init method is called with a true health parameter, the Health field is initialized with a default ClusterHealth status of "green" if it is currently nil.

  • core/elastic/actions.go: Added initialization of Health field with a default ClusterHealth status of "green" when health is true and Health is nil.

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@luohoufu luohoufu requested review from medcl and silenceqi February 13, 2025 13:15
@medcl medcl merged commit d11fe5b into main Feb 13, 2025
5 checks passed
@medcl medcl deleted the fix_cluster_health_nil_pr branch February 13, 2025 14:19
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.

3 participants