Skip to content

Commit

Permalink
cluster: fix the bug about status #158
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke committed Aug 3, 2021
1 parent f6f8441 commit e820782
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cluster/syncer/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ func (s *StatefulSetSyncer) updatePod(ctx context.Context) error {
log.Info("statefulSet was changed, run update")

if s.sfs.Status.ReadyReplicas < s.sfs.Status.Replicas {
return fmt.Errorf("can't start/continue 'update': waiting for all replicas are ready")
log.Info("can't start/continue 'update': waiting for all replicas are ready")
return nil
}

pods := corev1.PodList{}
Expand Down
4 changes: 3 additions & 1 deletion cluster/syncer/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ func (s *StatusSyncer) updateNodeStatus(ctx context.Context, cli client.Client,
log.Error(err, "cannot update pod", "name", podName, "namespace", pod.Namespace)
}
}

if len(pods) != int(*s.Spec.Replicas) {
return fmt.Errorf("not all replicas do something")
}
return nil
}

Expand Down

0 comments on commit e820782

Please sign in to comment.