Light up UpdatePod (#613)

* Light up UpdatePod

This PR updates the vkublet/pod.go createOrUpdate(..) method to actually handle
updates. It gets the pod from the provider as before, but now if it exists the method
checks the hash of the spec against the spec of the new pod. If they've changed, it
calls UpdatePod(..).

Also makes a small change to the Server struct to swap from kuberentes.Clientset to kubernetes.Interface
to better facilitate testing with fake ClientSet.

Co-Authored-By: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Jeremy Rickard
2019-05-17 12:14:29 -06:00
committed by Brian Goff
parent a3f933d998
commit 87e72bf4df
5 changed files with 384 additions and 42 deletions

View File

@@ -22,7 +22,7 @@ const (
type Server struct {
namespace string
nodeName string
k8sClient *kubernetes.Clientset
k8sClient kubernetes.Interface
provider providers.Provider
resourceManager *manager.ResourceManager
podSyncWorkers int