Skip to content

Commit 2d0aa28

Browse files
committed
feat(dbm-services): tendbha转移业务增加标准化流程 TencentBlueKing#13450
1 parent 91320b2 commit 2d0aa28

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

dbm-ui/backend/flow/engine/bamboo/scene/common/transfer_cluster_to_other_biz.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
specific language governing permissions and limitations under the License.
1010
"""
1111

12+
import copy
1213
import logging
1314
from typing import Dict, List, Optional, Set
1415

@@ -17,11 +18,14 @@
1718
from backend.db_meta.enums import ClusterEntryRole, ClusterEntryType
1819
from backend.db_meta.models import Cluster, ClusterEntry
1920
from backend.flow.engine.bamboo.scene.common.builder import Builder
21+
from backend.flow.engine.bamboo.scene.mysql.deploy_peripheraltools.departs import ALLDEPARTS
22+
from backend.flow.engine.bamboo.scene.mysql.deploy_peripheraltools.subflow import (
23+
standardize_mysql_cluster_by_cluster_subflow,
24+
)
2025
from backend.flow.plugins.components.collections.common.clone_priv_rules_to_other_biz import (
2126
ClonePrivRulesToOtherComponent,
2227
)
2328
from backend.flow.plugins.components.collections.common.generate_config_version import GenerateConfigVersionComponent
24-
from backend.flow.plugins.components.collections.common.pause import PauseComponent
2529
from backend.flow.plugins.components.collections.common.transfer_cluster_meta_to_other_biz import (
2630
TransferClusterMetaToOtherBizComponent,
2731
UpdateClusterDnsBelongAppComponent,
@@ -140,9 +144,27 @@ def transfer_to_other_biz_flow(self):
140144
"method": "GenerateAndPublish",
141145
},
142146
)
143-
144-
p.add_act(act_name=_("请先跑一下集群标准化,完成之后确认"), act_component_code=PauseComponent.code, kwargs={})
145-
147+
# 标准化集群
148+
cloud_cluster_ids = [cluster.id for cluster in clusters]
149+
p.add_sub_pipeline(
150+
sub_flow=standardize_mysql_cluster_by_cluster_subflow(
151+
root_id=self.root_id,
152+
data=copy.deepcopy(self.data),
153+
bk_cloud_id=bk_cloud_id,
154+
bk_biz_id=self.target_biz_id,
155+
cluster_ids=list(set(cloud_cluster_ids)),
156+
departs=ALLDEPARTS,
157+
with_deploy_binary=self.data.get("with_deploy_binary", True),
158+
with_push_config=self.data.get("with_push_config", True),
159+
with_collect_sysinfo=False,
160+
with_actuator=True,
161+
with_bk_plugin=self.data.get("with_deploy_binary", True),
162+
with_cc_standardize=self.data.get("with_cc_standardize", False),
163+
with_instance_standardize=self.data.get("with_instance_standardize", False),
164+
with_backup_client=self.data.get("with_deploy_binary", True),
165+
with_exporter_config=self.data.get("with_push_config", True),
166+
)
167+
)
146168
p.add_act(
147169
act_name=_("更新dns记录归属业务"),
148170
act_component_code=UpdateClusterDnsBelongAppComponent.code,

0 commit comments

Comments
 (0)