-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement dry-run for install/upgrade process #464
Conversation
Results test-case(failure): test-case(success): test case(success): |
The approach is ok, working on the implementation details. |
All procedure should be supported. If it is impossible, please introduce new option --dry-run and specify which procedures support it and which do not. Currently, --without-act is supported by all procedures except |
If it is possible, please make unit tests that will run the procedures in dry-run. |
if args.get('without_act', False): | ||
cluster.context["dry_run"] = True |
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 suggest to not recreate the inventory on the deployer. For example, if you run upgrade, the input cluster.yaml will be changed. This does not seem as "dry-run". I suggest to create separate file in dump/ and reflect the changes there.
kubemarine/core/group.py
Outdated
@_handle_dry_run | ||
def run(self, *args, **kwargs) -> Union[NodeGroupResult, int]: |
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 suggest to not call NodeGroup.run/sudo/put for RW operations in dry run at all. The reason is it is difficult to simulate its behaviour. For example, you return empty results, but in fact it returns not empty results in real run. So this can lead to unpredictable changes in behaviour of Kubemarine. Also, put does not return result at all, run/sudo might return int
in some cases, and so on...
@@ -1018,14 +1029,14 @@ def apply_source(cluster: KubernetesCluster, config: dict) -> None: | |||
else: | |||
apply_common_group = cluster.create_group_from_groups_nodes_names(apply_groups, apply_nodes) | |||
|
|||
destination_common_group.put(source, destination_path, backup=True, sudo=use_sudo) | |||
destination_common_group.put(source, destination_path, backup=True, sudo=use_sudo, dry_run=dry_run) | |||
|
|||
if apply_required: | |||
method = apply_common_group.run | |||
if use_sudo: | |||
method = apply_common_group.sudo | |||
cluster.log.debug("Applying yaml...") |
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.
Minor moment, rendering of plugins' templates might depend on previous shell commands. See runtime_vars
. If it is possible, I suggest to skip rendering of templates in such cases, because its result will likely be not the same as during the real run.
Need to complete rework |
Description
This improvement is to enable dry-run for installation and upgrade procedure of Kubemarine using the existing --without-act option
Solution
Improvement
*
How to apply
Code change
Test Cases
TestCase 1
Steps:
TestCase 2
Steps:
TestCase 3
Steps:
Checklist