Skip to content

Commit 7b314cd

Browse files
authored
fix: clickhouse switchover failed (#9690)
1 parent 0465862 commit 7b314cd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/controller/instance/reconciler_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (r *updateReconciler) switchover(tree *kubebuilderx.ObjectTree, inst *workl
210210
}
211211
return m
212212
}()
213-
lfa, err := lifecycle.New(inst.Namespace, clusterName, inst.Spec.InstanceSetName, lifecycleActions, templateVars, pod)
213+
lfa, err := lifecycle.New(inst.Namespace, clusterName, inst.Labels[constant.KBAppComponentLabelKey], lifecycleActions, templateVars, pod)
214214
if err != nil {
215215
return err
216216
}

pkg/controller/instanceset/reconciler_update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (r *updateReconciler) switchover(tree *kubebuilderx.ObjectTree, its *worklo
280280
}
281281
return m
282282
}()
283-
lfa, err := lifecycle.New(its.Namespace, clusterName, its.Name, lifecycleActions, templateVars, pod)
283+
lfa, err := lifecycle.New(its.Namespace, clusterName, its.Labels[constant.KBAppComponentLabelKey], lifecycleActions, templateVars, pod)
284284
if err != nil {
285285
return err
286286
}
@@ -334,7 +334,7 @@ func (r *updateReconciler) reconfigureConfig(tree *kubebuilderx.ObjectTree, its
334334
}
335335
return m
336336
}()
337-
lfa, err := lifecycle.New(its.Namespace, clusterName, its.Name, lifecycleActions, templateVars, pod)
337+
lfa, err := lifecycle.New(its.Namespace, clusterName, its.Labels[constant.KBAppComponentLabelKey], lifecycleActions, templateVars, pod)
338338
if err != nil {
339339
return err
340340
}

0 commit comments

Comments
 (0)