Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: fix the bug change yaml will happen nothing #158 #166

Merged
merged 3 commits into from
Aug 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cluster/syncer/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,15 @@ func (s *StatefulSetSyncer) applyNWait(ctx context.Context, pod *corev1.Pod) err
if err != nil && !k8serrors.IsNotFound(err) {
return false, err
}
ordinal, err := utils.GetOrdinal(pod.Name)
andyli029 marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return false, err
}

if ordinal >= int(*s.Spec.Replicas) {
andyli029 marked this conversation as resolved.
Show resolved Hide resolved
log.Info("retry waiting pod", "pod", pod.Name)
zhyass marked this conversation as resolved.
Show resolved Hide resolved
return true, nil
}
if pod.Status.Phase == corev1.PodFailed {
return false, fmt.Errorf("pod %s is in failed phase", pod.Name)
}
Expand Down