Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

[WIP] Update cluster init before upgrade #1110

Closed
wants to merge 1 commit into from

Conversation

mjura
Copy link
Contributor

@mjura mjura commented May 15, 2020

Why is this PR needed?

For migration between CaaSP 4.2.1 and CaaSP 4.3 cluster addons directory should be updated. It was already covered by release notes
https://github.com/SUSE/caasp-release-notes/pull/51/files
This has to be also covered by our CI framework

What does this PR do?

skuba cluster init --control-plane <PUBLIC_IP> /tmp/test-cluster
mv /tmp/test-cluster/addons/cri/conf.d <CURRENT-CLUSTER-NAME>/addons/cri/
rm <CURRENT-CLUSTER-NAME>/addons/cri/default_flags

Merge restrictions

(Please do not edit this)

We are in v4-maintenance phase, so we will restrict what can be merged to prevent unexpected surprises:

What can be merged (merge criteria):
    2 approvals:
        1 developer: code is fine
        1 QA: QA is fine
    there is a PR for updating documentation (or a statement that this is not needed)

@mjura mjura changed the title Update cluster init before upgrade [WIP] Update cluster init before upgrade May 15, 2020
@mjura mjura requested a review from pablochacin May 15, 2020 09:50
@@ -50,18 +50,20 @@ def cluster_deploy(self, kubernetes_version=None, cloud_provider=None,


@step
def cluster_init(self, kubernetes_version=None, cloud_provider=None):
def cluster_init(self, kubernetes_version=None, cloud_provider=None, path=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -154,6 +156,10 @@ def node_remove(self, role="worker", nr=0):
def node_upgrade(self, action, role, nr, ignore_errors=False):
self._verify_bootstrap_dependency()

self.cluster_init("", "", "/tmp")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm worried if this is a one-time fix. That is, IIRC this applies only when upgrading from cri-0 1.17 to 1.18 but not in other cases.

@@ -223,3 +229,18 @@ def _run_skuba(self, cmd, cwd=None, verbosity=None, ignore_errors=False):
cwd=cwd,
ignore_errors=ignore_errors,
)

def _run_os_cmd(self, cmd, cwd=None, ignore_errors=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

I only see you are using this _run_os_cmd once. Any reason for not calling runshlelcommand directly?

@@ -154,6 +156,10 @@ def node_remove(self, role="worker", nr=0):
def node_upgrade(self, action, role, nr, ignore_errors=False):
self._verify_bootstrap_dependency()

self.cluster_init("", "", "/tmp")
cmd = "rsync -a /tmp/test-cluster/addons/ addons/"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this hardcoded path for several reasons. First, In the CI, for example it is unsafe to use /tmp. I would be safer to create a tmp directory in the workspace directory.

Also, instead of hardcoding test-cluster you could better use the configuration parameter self.config.skuba.cluster because the cluster_init function will use it.

@mjura mjura force-pushed the test_upgrade_init branch from 97f0128 to b92a081 Compare May 19, 2020 07:06
@mjura mjura force-pushed the test_upgrade_init branch from b92a081 to da4729b Compare May 19, 2020 07:09
@jenting
Copy link

jenting commented Jul 21, 2020

related to #1251

@mjura
Copy link
Contributor Author

mjura commented Nov 10, 2020

it is not needed any more

@mjura mjura closed this Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants