+ def _get_upgrade_scale_command(
+ self,
+ kdu_model: str,
+ kdu_instance: str,
+ namespace: str,
+ scale: int,
+ version: str,
+ atomic: bool,
+ replica_str: str,
+ timeout: float,
+ resource_name: str,
+ kubeconfig: str,
+ ) -> str:
+
+ timeout_str = ""
+ if timeout:
+ timeout_str = "--timeout {}s".format(timeout)
+
+ # atomic
+ atomic_str = ""
+ if atomic:
+ atomic_str = "--atomic"
+
+ # version
+ version_str = ""
+ if version:
+ version_str = "--version {}".format(version)
+
+ # scale
+ if resource_name:
+ scale_dict = {"{}.{}".format(resource_name, replica_str): scale}
+ else:
+ scale_dict = {replica_str: scale}
+
+ scale_str = self._params_to_set_option(scale_dict)
+
+ command = (
+ "env KUBECONFIG={kubeconfig} {helm} upgrade {atomic} --output yaml {scale} {timeout} {name} {model} {ver}"
+ ).format(
+ helm=self._helm_command,
+ name=kdu_instance,
+ atomic=atomic_str,
+ scale=scale_str,
+ timeout=timeout_str,
+ model=kdu_model,
+ ver=version_str,
+ kubeconfig=kubeconfig,
+ )
+ return command
+