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 remote harbor healthcheck functionality #21674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gnetanel
Copy link

@gnetanel gnetanel commented Feb 26, 2025

Comprehensive Summary of your change

The review contain two changes:
The first is adding implementation for HealthCheck in src/pkg/reg/adapter/harbor/v2/adapter.go The second general issue, in which a change made in src/controller/registry/controller.go by removing the continue inside the loop, the continue prevent from updating regMgr.Update with the status change

Issue being fixed

Fixes #21673

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@gnetanel gnetanel requested a review from a team as a code owner February 26, 2025 09:24
The review contain two changes:
The first is adding implementation for HealthCheck in src/pkg/reg/adapter/harbor/v2/adapter.go
The second general issue, in which a change made in src/controller/registry/controller.go by removing the continue inside the loop,
the continue prevent from updating regMgr.Update with the status change

Signed-off-by: Gal Netanel <[email protected]>
@gnetanel gnetanel force-pushed the fix_remote_harbor_healthcheck_functionality branch from ee3d029 to 7bebf28 Compare February 26, 2025 09:33
Copy link
Contributor

@bupd bupd left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

Left my suggestions below and Also commented my thoughts on this issue in #21673 (comment)

@@ -232,7 +232,6 @@ func (c *controller) StartRegularHealthCheck(ctx context.Context, closing, done
isHealthy, err := c.IsHealthy(ctx, registry)
if err != nil {
log.Errorf("failed to check health of registry %d: %v", registry.ID, err)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest not changing this. Since this not only depends on harbor-adapter but also other registry adapters

Copy link
Author

Choose a reason for hiding this comment

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

Indeed,
The commit has two parts, a missing implementation for harbor and general issue which is the above.
If C.IsHealthy return error, code continue and the status of endpoint won't get updated, i.e: it would remain Healthy while endpoint is not accessible (I manage to cause this by changing remote hardware endpoint core deployment to 0 replica and also by disconnecting it from the network)

If the 'continue' will be removed, the code has the right logic to check isHealthy variable and update accordingly, , if the continue will remain, the Status of endpoint won't get updated, so i think this indeed apply to all registries and should be changed.

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.

Remote registry harbor is always healthy
5 participants