Skip to content

Commit 685c910

Browse files
committed
sync claim status
Signed-off-by: Aylei <rayingecho@gmail.com>
1 parent 37bef14 commit 685c910

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎pkg/controllers/cnclaim/controller.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (r *Actor) doClaimCN(ctx *recon.Context[*v1alpha1.CNClaim], orphans []corev
139139
baseSelector := common.MustAsSelector(c.Spec.Selector)
140140
podSelector := baseSelector.Add(common.MustEqual(v1alpha1.CNPodPhaseLabel, v1alpha1.CNPodPhaseIdle))
141141
if c.Spec.PoolName != "" {
142-
podSelector = podSelector.Add(common.MustEqual(v1alpha1.PoolNameLabel, c.Spec.PodName))
142+
podSelector = podSelector.Add(common.MustEqual(v1alpha1.PoolNameLabel, c.Spec.PoolName))
143143
}
144144
idleCNs, err := common.ListPods(ctx, client.InNamespace(c.Namespace), client.MatchingLabelsSelector{Selector: podSelector})
145145
if err != nil && !apierrors.IsNotFound(err) {

‎pkg/controllers/cnstore/pooling.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func (c *withCNSet) poolingCNReconcile(ctx *recon.Context[*corev1.Pod]) error {
6666
if err != nil {
6767
return errors.Wrap(err, "error patch CN phase idle")
6868
}
69+
} else {
70+
ctx.Log.V(4).Info("CN Pod not ready")
6971
}
7072
default:
7173
return errors.Errorf("unkown CN phase %s", pod.Labels[v1alpha1.CNPodPhaseLabel])

‎pkg/hacli/hakeeper_client.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func (m *HAKeeperClientManager) doGC() {
120120
err := m.kubeCli.Get(context.TODO(), v.lsRef, ls)
121121
if err != nil {
122122
if apierrors.IsNotFound(err) {
123+
m.logger.Info("logset deleted, clean handler", "logset", v.lsRef)
123124
delete(m.logSetToClients, uid)
124125
closeFn()
125126
continue
@@ -129,6 +130,7 @@ func (m *HAKeeperClientManager) doGC() {
129130
}
130131
// logset has been re-created, clean stale cache
131132
if ls.UID != uid && recon.IsReady(ls) {
133+
m.logger.Info("logset recreated, clean legeacy handler", "logset", v.lsRef, "old UID", uid, "new UID", ls.UID)
132134
delete(m.logSetToClients, uid)
133135
closeFn()
134136
}

0 commit comments

Comments
 (0)