Skip to content

Conversation

@luohoufu
Copy link
Contributor

@luohoufu luohoufu commented Mar 27, 2025

What does this PR do

This pull request includes a change to the clusterHealthCheck function in the modules/elastic/metadata.go file. The change introduces an additional condition to the health check logic.

Modification to health check logic:

  • modules/elastic/metadata.go: Added a force parameter check to the condition that updates the cluster health status. This ensures that the health status is updated even if the cluster is available but the force parameter is set to true.

Rationale for this change

(#81)

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 a review from Copilot March 27, 2025 07:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR fixes an issue in the cluster health check logic by ensuring that the health status is updated when the force parameter is true, preventing the default green setting from masking initialization issues.

  • Introduced a force parameter check in the health status update condition.
  • Updated release notes to reflect the change.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/content.en/docs/release-notes/_index.md Added record for the fix in the release notes.
modules/elastic/metadata.go Modified health check logic to update the cluster status when force is true.
Comments suppressed due to low confidence (1)

modules/elastic/metadata.go:80

  • Consider adding tests to explicitly verify that the updateClusterHealthStatus function is called when the force parameter is true, ensuring the forced update behavior is consistently maintained.
if metadata.Health == nil || metadata.Health.Status != health.Status || !metadata.IsAvailable() || force {

@medcl medcl merged commit e201374 into main Mar 27, 2025
5 checks passed
@medcl medcl deleted the fix_cluster_health branch March 27, 2025 07:07
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.

5 participants