mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Kubelet: recreate mirror pod if the static pod changes
If a static pod changes, delete the corresponding mirror pod. When kubelet could not see mirror pod from the API server update, it'd attemp to create a new mirror pod with up-to-date specs.
This commit is contained in:
@@ -74,6 +74,9 @@ func applyDefaults(pod *api.Pod, source string, isFile bool, hostname string) er
|
||||
}
|
||||
glog.V(5).Infof("Using namespace %q for pod %q from %s", pod.Namespace, pod.Name, source)
|
||||
|
||||
// Set the Host field to indicate this pod is scheduled on the current node.
|
||||
pod.Spec.Host = hostname
|
||||
|
||||
// Currently just simply follow the same format in resthandler.go
|
||||
pod.ObjectMeta.SelfLink =
|
||||
fmt.Sprintf("/api/v1beta2/pods/%s?namespace=%s", pod.Name, pod.Namespace)
|
||||
|
||||
Reference in New Issue
Block a user