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

feat: Add Core Keeper registry client #138

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

jackchenjc
Copy link
Contributor

@jackchenjc jackchenjc commented Feb 22, 2024

closes #134

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 52.41158% with 148 lines in your changes are missing coverage. Please review.

Project coverage is 67.33%. Comparing base (289b60e) to head (64f008f).

Files Patch % Lines
internal/pkg/keeper/client.go 49.24% 81 Missing and 20 partials ⚠️
internal/pkg/keeper/mock_keeper.go 59.63% 37 Missing and 7 partials ⚠️
registry/factory.go 0.00% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #138       +/-   ##
===========================================
- Coverage   83.62%   67.33%   -16.29%     
===========================================
  Files           3        5        +2     
  Lines         287      597      +310     
===========================================
+ Hits          240      402      +162     
- Misses         25      146      +121     
- Partials       22       49       +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

registry/factory.go Outdated Show resolved Hide resolved
internal/pkg/keeper/client.go Outdated Show resolved Hide resolved
}

func (k *keeperClient) RegisterCheck(id string, name string, notes string, url string, interval string) error {
// keeper combines service discovery and health check into one single register request
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be implemented. The are users that have added additional RegisterChecks via this API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keeper does not support this for now, may be an enhancement in the future.

Copy link
Member

Choose a reason for hiding this comment

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

That is a breaking change then as this is current functionality when using Consul. @cloudxxx8 FYI.

Copy link
Member

Choose a reason for hiding this comment

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

@lenny-intel it's not really breaking anything
core-keeper requires the healthcheck setting when the registration creation
https://github.com/edgexfoundry/go-mod-core-contracts/blob/7c7fc6d4916a7b9a2c91d36c929726a20a3654c9/dtos/registration.go#L20

Consul requires a separated call to this RegisterCheck, but there is no impact if core-keeper does nothing in RegisterCheck func

internal/pkg/keeper/consts.go Outdated Show resolved Hide resolved
internal/pkg/keeper/consts.go Outdated Show resolved Hide resolved
internal/pkg/keeper/mock_keeper.go Show resolved Hide resolved
internal/pkg/keeper/client.go Outdated Show resolved Hide resolved
internal/pkg/keeper/client.go Outdated Show resolved Hide resolved
closes edgexfoundry#134

Signed-off-by: Jack Chen <jack@iotechsys.com>
internal/pkg/keeper/client.go Show resolved Hide resolved
Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 dismissed lenny-goodell’s stale review March 28, 2024 07:19

request changes addressed

@cloudxxx8 cloudxxx8 merged commit 5eb2885 into edgexfoundry:main Mar 28, 2024
3 checks passed
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.

Add core keeper registry client
4 participants