From 5b2250869503d142837c2df7bf6bbd848e2e017e Mon Sep 17 00:00:00 2001 From: Jiaxin Shan Date: Sun, 24 Jan 2021 21:22:40 -0800 Subject: [PATCH] Get rid of ProviderFailed due to expected pod spec mismatch --- provider.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/provider.go b/provider.go index c6f82c5..90532e8 100644 --- a/provider.go +++ b/provider.go @@ -128,7 +128,15 @@ func (p *FargateProvider) CreatePod(ctx context.Context, pod *corev1.Pod) error // UpdatePod takes a Kubernetes Pod and updates it within the provider. func (p *FargateProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error { log.Printf("Received UpdatePod request for %s/%s.\n", pod.Namespace, pod.Name) - return errNotImplemented + + // There's no need to get scheduled pod and update it in Fargate. + // However, this is called in every loop. Even worse, created k8s pod object will never be same as provider pod, + // because service account token and some default tolerance will be added to pod spec. + // https://github.com/virtual-kubelet/virtual-kubelet/blob/bd742d5d99eafb0140f32def3b071028925d9dfa/node/pod.go#L75-L76 + // + // Returning any error will result in `ProviderFailed` status on the pod. We just return nil here. + + return nil } // DeletePod takes a Kubernetes Pod and deletes it from the provider.