(ctx context.Context, kubeClient kubectl.Client, pod *v1.Pod, log logpkg.Logger)
| 245 | } |
| 246 | |
| 247 | func PrintPodError(ctx context.Context, kubeClient kubectl.Client, pod *v1.Pod, log logpkg.Logger) bool { |
| 248 | // check if pod still exists |
| 249 | newPod, err := kubeClient.KubeClient().CoreV1().Pods(pod.Namespace).Get(ctx, pod.Name, metav1.GetOptions{}) |
| 250 | if err != nil { |
| 251 | if kerrors.IsNotFound(err) { |
| 252 | log.Errorf("Restarted because old pod %s/%s seems to be erased", pod.Namespace, pod.Name) |
| 253 | return true |
| 254 | } |
| 255 | |
| 256 | return false |
| 257 | } |
| 258 | if newPod.DeletionTimestamp != nil { |
| 259 | return true |
| 260 | } |
| 261 | |
| 262 | podStatus := kubectl.GetPodStatus(newPod) |
| 263 | if podStatus != "Running" { |
| 264 | log.Errorf("Restarted because old pod %s/%s has status %s", pod.Namespace, pod.Name, podStatus) |
| 265 | } |
| 266 | |
| 267 | return false |
| 268 | } |
| 269 | |
| 270 | func (c *controller) startSync(ctx devspacecontext.Context, options *Options, onInitUploadDone chan struct{}, onInitDownloadDone chan struct{}, onDone chan struct{}, onError chan error) (*sync.Sync, *selector.SelectedPodContainer, error) { |
| 271 | syncConfig := options.SyncConfig |
no test coverage detected