diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py index e4c9124e52..f1e4043e20 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py @@ -201,13 +201,12 @@ def aggregate_backup_log_by_id(self, backup_logs: List[Dict[str, Any]]) -> List[ for field in delete_fields: backup_id__backup_logs_map[backup_id].pop(field) - backup_id__backup_logs_map[backup_id]["file_list"].append(file_name) - backup_id__backup_logs_map[backup_id]["file_list_details"].append( - {"file_name": file_name, "size": log["file_size"], "task_id": log["task_id"]} - ) + file_info = {"file_name": file_name, "size": log["file_size"], "task_id": log["task_id"]} + backup_id__backup_logs_map[backup_id]["file_list"].append(file_info["file_name"]) + backup_id__backup_logs_map[backup_id]["file_list_details"].append(file_info) if log["file_type"] in ["index", "priv"]: - backup_id__backup_logs_map[log["backup_id"]][log["file_type"]] = file_name + backup_id__backup_logs_map[log["backup_id"]][log["file_type"]] = file_info return list(backup_id__backup_logs_map.values()) diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py index 78cc4d9ccc..12c0a43a95 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py @@ -55,7 +55,7 @@ def validate(self, attrs): class MysqlRestoreSlaveParamBuilder(builders.FlowParamBuilder): - controller = MySQLController.mysql_restore_slave_scene + controller = MySQLController.mysql_restore_slave_remote_scene def format_ticket_data(self): self.ticket_data["add_slave_only"] = False diff --git a/helm-charts/bk-dbm/Chart.lock b/helm-charts/bk-dbm/Chart.lock index b47c267dfe..eebbc3f624 100644 --- a/helm-charts/bk-dbm/Chart.lock +++ b/helm-charts/bk-dbm/Chart.lock @@ -4,13 +4,13 @@ dependencies: version: 1.13.0 - name: mysql repository: https://charts.bitnami.com/bitnami - version: 9.12.3 + version: 9.12.4 - name: redis repository: https://charts.bitnami.com/bitnami version: 16.13.2 - name: etcd repository: https://charts.bitnami.com/bitnami - version: 9.5.1 + version: 9.5.4 - name: grafana repository: file://./charts/grafana version: 7.9.8 @@ -50,5 +50,5 @@ dependencies: - name: backup-consumer repository: file://charts/backup-consumer version: 0.0.2 -digest: sha256:6b169baac096552bd3988867a19d3d4e4498abae76a118c0115a784018420783 -generated: "2023-10-09T17:52:12.115867+08:00" +digest: sha256:6b5728014c60aa1e59b0805b9c63a84915e3ed5ea1581f8f4546daf4c0602027 +generated: "2023-10-10T15:44:19.332544+08:00" diff --git a/helm-charts/bk-dbm/charts/dbpartition/templates/_helpers.tpl b/helm-charts/bk-dbm/charts/dbpartition/templates/_helpers.tpl index 87d1adcad9..ca08be5f6c 100644 --- a/helm-charts/bk-dbm/charts/dbpartition/templates/_helpers.tpl +++ b/helm-charts/bk-dbm/charts/dbpartition/templates/_helpers.tpl @@ -60,3 +60,14 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +k8sWaitFor Image +*/}} +{{- define "dbpartition.k8sWaitFor.image" -}} +{{- if and .Values.global .Values.global.imageRegistry -}} + {{- include "common.images.image" (dict "imageRoot" .Values.image.k8sWaitFor "global" .Values.global) -}} +{{- else -}} + {{- include "dbm.migration.image" (dict "image" .Values.image.k8sWaitFor "imageRoot" .Values.image) -}} +{{- end -}} +{{- end -}} diff --git a/helm-charts/bk-dbm/charts/dbpartition/templates/deployment.yaml b/helm-charts/bk-dbm/charts/dbpartition/templates/deployment.yaml index 8b4282fab1..4831b94afa 100644 --- a/helm-charts/bk-dbm/charts/dbpartition/templates/deployment.yaml +++ b/helm-charts/bk-dbm/charts/dbpartition/templates/deployment.yaml @@ -48,11 +48,11 @@ spec: {{- toYaml .Values.resources | nindent 12 }} initContainers: - name: check-saas-api - image: {{ include "dbm.migration.k8sWaitFor.image" . }} + image: {{ include "dbpartition.k8sWaitFor.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} args: - pod - - -lapp.kubernetes.io/component={{ include "dbm.saas-api.fullname" .}} + - -lapp.kubernetes.io/component=bk-dbm-saas-api resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/helm-charts/bk-dbm/charts/dbpartition/templates/serviceaccount.yaml b/helm-charts/bk-dbm/charts/dbpartition/templates/serviceaccount.yaml index 7a5ddd5ef8..61be9fc8dc 100644 --- a/helm-charts/bk-dbm/charts/dbpartition/templates/serviceaccount.yaml +++ b/helm-charts/bk-dbm/charts/dbpartition/templates/serviceaccount.yaml @@ -9,4 +9,33 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "dbpartition.fullname" . }}-role +rules: +- apiGroups: + - batch + - "" + resources: + - jobs + - pods + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "dbpartition.fullname" . }}-role-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "dbpartition.fullname" . }}-role +subjects: +- kind: ServiceAccount + name: {{ include "dbpartition.serviceAccountName" . }} + namespace: {{ default "default" .Release.Namespace }} {{- end }} diff --git a/helm-charts/bk-dbm/charts/dbpartition/values.yaml b/helm-charts/bk-dbm/charts/dbpartition/values.yaml index f6984479c2..fc7866e29d 100644 --- a/helm-charts/bk-dbm/charts/dbpartition/values.yaml +++ b/helm-charts/bk-dbm/charts/dbpartition/values.yaml @@ -10,6 +10,11 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" + k8sWaitFor: + registry: "mirrors.tencent.com" + repository: "build/blueking/k8s-wait-for" + tag: "v1.5.1" + imagePullSecrets: [] nameOverride: "" fullnameOverride: "bk-dbm-dbpartition"