Skip to content

refactor: admin client#79

Merged
g1eny0ung merged 6 commits intohstreamdb:mainfrom
g1eny0ung:refactor/admin-client
Dec 12, 2023
Merged

refactor: admin client#79
g1eny0ung merged 6 commits intohstreamdb:mainfrom
g1eny0ung:refactor/admin-client

Conversation

@g1eny0ung
Copy link
Contributor

This PR is a part of #76. I divided some standalone changes to reduce the size of the original PR.

Changes

In the old implementation, we only specified some isolated admin commands like BootstrapHServer or BootstrapHStore, etc. This does not apply to subsequent changes because if other admin commands are integrated into controllers, we need a public method to execute various commands to avoid rewriting tedious code.

So this PR extracts two packages: selector and executor, one is for selecting k8s resources like pods, and one is for executing admin commands (some of them will execute in pods). The internal/admin will use the executor to perform more specific tasks. Like bootstrapping hservers, as above said.

@codecov
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (3783e3c) 82.78% compared to head (d4e9547) 83.54%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/executor/executor.go 79.54% 6 Missing and 3 partials ⚠️
internal/admin/client_mock.go 0.00% 8 Missing ⚠️
internal/admin/client.go 81.81% 5 Missing and 1 partial ⚠️
internal/admin/types.go 62.50% 4 Missing and 2 partials ⚠️
pkg/selector/pods.go 82.35% 2 Missing and 1 partial ⚠️
internal/controller/bootstrap_hserver.go 60.00% 1 Missing and 1 partial ⚠️
internal/controller/bootstrap_hstore.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   82.78%   83.54%   +0.76%     
==========================================
  Files          40       43       +3     
  Lines        2474     2413      -61     
==========================================
- Hits         2048     2016      -32     
+ Misses        314      294      -20     
+ Partials      112      103       -9     

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

@g1eny0ung g1eny0ung marked this pull request as ready for review December 11, 2023 08:21
@g1eny0ung g1eny0ung requested a review from Rory-Z as a code owner December 11, 2023 08:21
@g1eny0ung g1eny0ung merged commit 7582d5f into hstreamdb:main Dec 12, 2023
@g1eny0ung g1eny0ung deleted the refactor/admin-client branch December 12, 2023 03:12
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.

2 participants