-
Notifications
You must be signed in to change notification settings - Fork 284
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
CP-51988: Fix functions not work for remote_pool repo #6095
base: feature/easier-pool-join
Are you sure you want to change the base?
CP-51988: Fix functions not work for remote_pool repo #6095
Conversation
a76de9a
to
615326d
Compare
615326d
to
a76cebb
Compare
a76cebb
to
340d27f
Compare
340d27f
to
170c700
Compare
170c700
to
ab89079
Compare
Java SDK build failed on:
Consider change the name "repo-type" to "repo_type" ? |
ab89079
to
48f640f
Compare
Updated to "repo_type" and it passed now. |
ocaml/xapi-consts/api_errors.ml
Outdated
add_error "BUNDLE_REPO_SHOULD_BE_SINGLE_ENABLED" | ||
let can_not_periodic_sync_updates = add_error "CAN_NOT_PERIODIC_SYNC_UPDATES" | ||
|
||
let repo_should_be_single_enabled = add_error "REPO_SHOULD_BE_SINGLE_ENABLED" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording is a bit odd. Does this mean that only one repo should be enabled? "repo should be single enabled" is not grammatical and ambiguous. "repo should be the single one enabled" could be something I would guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that only one repo should be enabled?
If the bundle repository or remote_pool repository is enabled, it should be the only one enabled repository of the pool. Or else, multiple repos (only remote) can be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe MULTIPLE_REPOS_ENABLED
as an error is clear? It implies that only one should be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
MULTIPLE_REPOS_ENABLED
as an error is clear? It implies that only one should be enabled.
It sounds better. But there is another similar error multiple_update_repositories_enabled
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree renaming it to repo_should_be_the_single_one_enabled
would be clearer.
ocaml/tests/test_pool_repository.ml
Outdated
( repo_should_be_single_enabled | ||
, [ | ||
Record_util.repo_origin_to_string `bundle | ||
; Record_util.repo_origin_to_string `remote_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No remote_pool
type of repo is set here
ocaml/tests/test_pool_repository.ml
Outdated
Server_error | ||
( repo_should_be_single_enabled | ||
, [ | ||
Record_util.repo_origin_to_string `bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No bundle
type of repo is set here.
ocaml/tests/test_pool_repository.ml
Outdated
( repo_should_be_single_enabled | ||
, [ | ||
Record_util.repo_origin_to_string `bundle | ||
; Record_util.repo_origin_to_string `remote_pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No remote_pool
type of repo is set.
ocaml/tests/test_pool_repository.ml
Outdated
Server_error | ||
( repo_should_be_single_enabled | ||
, [ | ||
Record_util.repo_origin_to_string `bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No bundle
type of repo is set
48f640f
to
98e7102
Compare
1. `remote_pool` repo doesn't support periodic sync updates. 2. Periodic sync updates should be auto-disabled when calling `set_repositories` and `add_repository` for `remote_pool` repo. 3. If `remote_pool` repository is enabled, it should be the single one enabled. Signed-off-by: Bengang Yuan <[email protected]>
Signed-off-by: Bengang Yuan <[email protected]>
98e7102
to
a2a7936
Compare
@@ -551,3 +551,11 @@ let vm_placement_policy_of_string a = | |||
`anti_affinity | |||
| s -> | |||
record_failure "Invalid VM placement policy, got %s" s | |||
|
|||
let repo_origin_to_string = function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this and we can rely on the auto-generated function now. See the comment on top of this file.
remote_pool
repo doesn't support periodic sync updates.set_repositories
andadd_repository
forremote_pool
repo.