From add04834dd4adac2f7b7e60af7e3792354dd4955 Mon Sep 17 00:00:00 2001 From: Shelley-BaoYue Date: Fri, 15 Sep 2023 16:10:18 +0800 Subject: [PATCH] update vendor Signed-off-by: Shelley-BaoYue --- .../pkg/kubelet/eviction/eviction_manager.go | 3 + .../k8s.io/kubernetes/pkg/kubelet/kubelet.go | 90 ++++++++++++- .../kubernetes/pkg/kubelet/kubelet_pods.go | 31 ++++- .../pkg/kubelet/pod/mirror_client.go | 115 ++++++++++++++++ .../kubernetes/pkg/kubelet/pod/pod_manager.go | 124 +++++++++++++++++- .../kubernetes/pkg/kubelet/pod_workers.go | 7 +- .../k8s.io/kubernetes/pkg/kubelet/runonce.go | 7 +- .../pkg/kubelet/status/status_manager.go | 26 +++- .../pkg/kubelet/types/pod_update.go | 9 +- vendor/modules.txt | 102 +++++++------- 10 files changed, 442 insertions(+), 72 deletions(-) diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go b/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go index daf415f13f6..9056507c00e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/eviction_manager.go @@ -65,6 +65,8 @@ type managerImpl struct { config Config // the function to invoke to kill a pod killPodFunc KillPodFunc + // the function to get the mirror pod by a given static pod + mirrorPodFunc MirrorPodFunc // the interface that knows how to do image gc imageGC ImageGC // the interface that knows how to do container gc @@ -120,6 +122,7 @@ func NewManager( manager := &managerImpl{ clock: clock, killPodFunc: killPodFunc, + mirrorPodFunc: mirrorPodFunc, imageGC: imageGC, containerGC: containerGC, config: config, diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go b/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go index 4f9813e4b60..9e14deba2d2 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet.go @@ -252,6 +252,17 @@ type Dependencies struct { useLegacyCadvisorStats bool } +// makePodSourceConfig creates a config.PodConfig from the given +// KubeletConfiguration or returns an error. +func makePodSourceConfig(cfg *config.PodConfig, kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *Dependencies, nodeName types.NodeName, nodeHasSynced func() bool) { + if kubeCfg.StaticPodPath != "" { + klog.InfoS("Adding static pod path", "path", kubeCfg.StaticPodPath) + kubeCfg.FileCheckFrequency = metav1.Duration{Duration: 10 * time.Second} + ctx := context.TODO() + config.NewSourceFile(kubeCfg.StaticPodPath, nodeName, kubeCfg.FileCheckFrequency.Duration, cfg.Channel(ctx, kubetypes.FileSource)) + } +} + // PreInitRuntimeService will init runtime service before RunKubelet. func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *Dependencies, @@ -332,6 +343,12 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, nodeLister = corelisters.NewNodeLister(nodeIndexer) nodeHasSynced = func() bool { return true } + if kubeDeps.PodConfig != nil { + makePodSourceConfig(kubeDeps.PodConfig, kubeCfg, kubeDeps, nodeName, nodeHasSynced) + } else { + return nil, fmt.Errorf("KubeDeps.Podconfig is nil,static pod path list-watch failed") + } + containerGCPolicy := kubecontainer.GCPolicy{ MinAge: minimumGCAge.Duration, MaxPerPodContainer: int(maxPerPodContainerCount), @@ -726,7 +743,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, // setup eviction manager evictionManager, evictionAdmitHandler := eviction.NewManager(klet.resourceAnalyzer, evictionConfig, - killPodNow(klet.podWorkers, kubeDeps.Recorder), nil, klet.imageManager, klet.containerGC, kubeDeps.Recorder, nodeRef, klet.clock, kubeCfg.LocalStorageCapacityIsolation) + killPodNow(klet.podWorkers, kubeDeps.Recorder), klet.podManager.GetMirrorPodByPod, klet.imageManager, klet.containerGC, kubeDeps.Recorder, nodeRef, klet.clock, kubeCfg.LocalStorageCapacityIsolation) klet.evictionManager = evictionManager klet.admitHandlers.AddPodAdmitHandler(evictionAdmitHandler) @@ -1475,7 +1492,7 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) { // This operation writes all events that are dispatched in order to provide // the most accurate information possible about an error situation to aid debugging. // Callers should not write an event if this operation returns an error. -func (kl *Kubelet) syncPod(_ context.Context, updateType kubetypes.SyncPodType, pod *v1.Pod, podStatus *kubecontainer.PodStatus) (isTerminal bool, err error) { +func (kl *Kubelet) syncPod(_ context.Context, updateType kubetypes.SyncPodType, pod, mirrorPod *v1.Pod, podStatus *kubecontainer.PodStatus) (isTerminal bool, err error) { // TODO(#113606): connect this with the incoming context parameter, which comes from the pod worker. // Currently, using that context causes test failures. ctx := context.TODO() @@ -1643,6 +1660,37 @@ func (kl *Kubelet) syncPod(_ context.Context, updateType kubetypes.SyncPodType, } } + // Create Mirror Pod for Static Pod if it doesn't already exist + if kubetypes.IsStaticPod(pod) { + deleted := false + if mirrorPod != nil { + if mirrorPod.DeletionTimestamp != nil || !kl.podManager.IsMirrorPodOf(mirrorPod, pod) { + // The mirror pod is semantically different from the static pod. Remove + // it. The mirror pod will get recreated later. + klog.InfoS("Trying to delete pod", "pod", klog.KObj(pod), "podUID", mirrorPod.ObjectMeta.UID) + podFullName := kubecontainer.GetPodFullName(pod) + var err error + deleted, err = kl.podManager.DeleteMirrorPod(podFullName, &mirrorPod.ObjectMeta.UID) + if deleted { + klog.InfoS("Deleted mirror pod because it is outdated", "pod", klog.KObj(mirrorPod)) + } else if err != nil { + klog.ErrorS(err, "Failed deleting mirror pod", "pod", klog.KObj(mirrorPod)) + } + } + } + if mirrorPod == nil || deleted { + node, err := kl.GetNode() + if err != nil || node.DeletionTimestamp != nil { + klog.V(4).InfoS("No need to create a mirror pod, since node has been removed from the cluster", "node", klog.KRef("", string(kl.nodeName))) + } else { + klog.V(4).InfoS("Creating a mirror pod for static pod", "pod", klog.KObj(pod)) + if err := kl.podManager.CreateMirrorPod(pod); err != nil { + klog.ErrorS(err, "Failed creating a mirror pod for", "pod", klog.KObj(pod)) + } + } + } + } + // Make data directories for the pod if err := kl.makePodDataDirs(pod); err != nil { kl.recorder.Eventf(pod, v1.EventTypeWarning, events.FailedToMakePodDataDirectories, "error making pod data directories: %v", err) @@ -2148,6 +2196,7 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir // Run the sync in an async worker. kl.podWorkers.UpdatePod(UpdatePodOptions{ Pod: pod, + MirrorPod: mirrorPod, UpdateType: syncType, StartTime: start, }) @@ -2157,6 +2206,16 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir } } +// TODO: handle mirror pods in a separate component (issue #17251) +func (kl *Kubelet) handleMirrorPod(mirrorPod *v1.Pod, start time.Time) { + // Mirror pod ADD/UPDATE/DELETE operations are considered an UPDATE to the + // corresponding static pod. Send update to the pod worker if the static + // pod exists. + if pod, ok := kl.podManager.GetPodByMirrorPod(mirrorPod); ok { + kl.dispatchWork(pod, kubetypes.SyncPodUpdate, mirrorPod, start) + } +} + // HandlePodAdditions is the callback in SyncHandler for pods being added from // a config source. func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) { @@ -2170,6 +2229,11 @@ func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) { // the apiserver and no action (other than cleanup) is required. kl.podManager.AddPod(pod) + if kubetypes.IsMirrorPod(pod) { + kl.handleMirrorPod(pod, start) + continue + } + // Only go through the admission process if the pod is not requested // for termination by another part of the kubelet. If the pod is already // using resources (previously admitted), the pod worker is going to be @@ -2187,8 +2251,8 @@ func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod) { continue } } - - kl.dispatchWork(pod, kubetypes.SyncPodCreate, nil, start) + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) + kl.dispatchWork(pod, kubetypes.SyncPodCreate, mirrorPod, start) } } @@ -2198,15 +2262,25 @@ func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod) { start := kl.clock.Now() for _, pod := range pods { kl.podManager.UpdatePod(pod) - kl.dispatchWork(pod, kubetypes.SyncPodUpdate, nil, start) + if kubetypes.IsMirrorPod(pod) { + kl.handleMirrorPod(pod, start) + continue + } + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) + kl.dispatchWork(pod, kubetypes.SyncPodUpdate, mirrorPod, start) } } // HandlePodRemoves is the callback in the SyncHandler interface for pods // being removed from a config source. func (kl *Kubelet) HandlePodRemoves(pods []*v1.Pod) { + start := kl.clock.Now() for _, pod := range pods { kl.podManager.DeletePod(pod) + if kubetypes.IsMirrorPod(pod) { + kl.handleMirrorPod(pod, start) + continue + } // Deletion is allowed to fail because the periodic cleanup routine // will trigger deletion again. if err := kl.deletePod(pod); err != nil { @@ -2226,7 +2300,8 @@ func (kl *Kubelet) HandlePodReconcile(pods []*v1.Pod) { // Reconcile Pod "Ready" condition if necessary. Trigger sync pod for reconciliation. if status.NeedToReconcilePodReadiness(pod) { - kl.dispatchWork(pod, kubetypes.SyncPodSync, nil, start) + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) + kl.dispatchWork(pod, kubetypes.SyncPodSync, mirrorPod, start) } // After an evicted pod is synced, all dead containers in the pod can be removed. @@ -2243,7 +2318,8 @@ func (kl *Kubelet) HandlePodReconcile(pods []*v1.Pod) { func (kl *Kubelet) HandlePodSyncs(pods []*v1.Pod) { start := kl.clock.Now() for _, pod := range pods { - kl.dispatchWork(pod, kubetypes.SyncPodSync, nil, start) + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) + kl.dispatchWork(pod, kubetypes.SyncPodSync, mirrorPod, start) } } diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go b/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go index d892fb5ef91..209024f91e4 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/kubelet_pods.go @@ -964,9 +964,29 @@ func (kl *Kubelet) removeOrphanedPodStatuses(pods []*v1.Pod, mirrorPods []*v1.Po for _, pod := range pods { podUIDs[pod.UID] = true } + for _, pod := range mirrorPods { + podUIDs[pod.UID] = true + } kl.statusManager.RemoveOrphanedStatuses(podUIDs) } +// deleteOrphanedMirrorPods checks whether pod killer has done with orphaned mirror pod. +// If pod killing is done, podManager.DeleteMirrorPod() is called to delete mirror pod +// from the API server +func (kl *Kubelet) deleteOrphanedMirrorPods() { + mirrorPods := kl.podManager.GetOrphanedMirrorPodNames() + for _, podFullname := range mirrorPods { + if !kl.podWorkers.IsPodForMirrorPodTerminatingByFullName(podFullname) { + _, err := kl.podManager.DeleteMirrorPod(podFullname, nil) + if err != nil { + klog.ErrorS(err, "Encountered error when deleting mirror pod", "podName", podFullname) + } else { + klog.V(3).InfoS("Deleted pod", "podName", podFullname) + } + } + } +} + // HandlePodCleanups performs a series of cleanup work, including terminating // pod workers, killing unwanted pods, and removing orphaned volumes/pod // directories. No config changes are sent to pod workers while this method @@ -1103,6 +1123,11 @@ func (kl *Kubelet) HandlePodCleanups(ctx context.Context) error { klog.ErrorS(err, "Failed cleaning up orphaned pod directories") } + // Remove any orphaned mirror pods (mirror pods are tracked by name via the + // pod worker) + klog.V(3).InfoS("Clean up orphaned mirror pods") + kl.deleteOrphanedMirrorPods() + // Remove any cgroups in the hierarchy for pods that are definitely no longer // running (not in the container runtime). if kl.cgroupsPerQOS { @@ -1130,8 +1155,9 @@ func (kl *Kubelet) HandlePodCleanups(ctx context.Context) error { continue } start := kl.clock.Now() + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) klog.V(3).InfoS("Pod is restartable after termination due to UID reuse", "pod", klog.KObj(pod), "podUID", pod.UID) - kl.dispatchWork(pod, kubetypes.SyncPodCreate, nil, start) + kl.dispatchWork(pod, kubetypes.SyncPodCreate, mirrorPod, start) } return nil @@ -1221,6 +1247,9 @@ func (kl *Kubelet) GetKubeletContainerLogs(ctx context.Context, podFullName, con } podUID := pod.UID + if mirrorPod, ok := kl.podManager.GetMirrorPodByPod(pod); ok { + podUID = mirrorPod.UID + } podStatus, found := kl.statusManager.GetPodStatus(podUID) if !found { // If there is no cached status, use the status from the diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go b/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go index cd96177f6e2..94ed020b738 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/pod/mirror_client.go @@ -17,12 +17,29 @@ limitations under the License. package pod import ( + "context" + "fmt" + v1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" clientset "k8s.io/client-go/kubernetes" + "k8s.io/klog/v2" + kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" + kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) // MirrorClient knows how to create/delete a mirror pod in the API server. type MirrorClient interface { + // CreateMirrorPod creates a mirror pod in the API server for the given + // pod or returns an error. The mirror pod will have the same annotations + // as the given pod as well as an extra annotation containing the hash of + // the static pod. + CreateMirrorPod(pod *v1.Pod) error + // DeleteMirrorPod deletes the mirror pod with the given full name from + // the API server or returns an error. + DeleteMirrorPod(podFullName string, uid *types.UID) (bool, error) } // nodeGetter is a subset of NodeLister, simplified for testing. @@ -48,3 +65,101 @@ func NewBasicMirrorClient(apiserverClient clientset.Interface, nodeName string, nodeGetter: nodeGetter, } } + +func (mc *basicMirrorClient) CreateMirrorPod(pod *v1.Pod) error { + if mc.apiserverClient == nil { + return nil + } + // Make a copy of the pod. + copyPod := *pod + copyPod.Annotations = make(map[string]string) + + for k, v := range pod.Annotations { + copyPod.Annotations[k] = v + } + hash := getPodHash(pod) + copyPod.Annotations[kubetypes.ConfigMirrorAnnotationKey] = hash + + // With the MirrorPodNodeRestriction feature, mirror pods are required to have an owner reference + // to the owning node. + // See https://git.k8s.io/enhancements/keps/sig-auth/1314-node-restriction-pods/README.md + nodeUID, err := mc.getNodeUID() + if err != nil { + return fmt.Errorf("failed to get node UID: %v", err) + } + controller := true + copyPod.OwnerReferences = []metav1.OwnerReference{{ + APIVersion: v1.SchemeGroupVersion.String(), + Kind: "Node", + Name: mc.nodeName, + UID: nodeUID, + Controller: &controller, + }} + + apiPod, err := mc.apiserverClient.CoreV1().Pods(copyPod.Namespace).Create(context.TODO(), ©Pod, metav1.CreateOptions{}) + if err != nil && apierrors.IsAlreadyExists(err) { + // Check if the existing pod is the same as the pod we want to create. + if h, ok := apiPod.Annotations[kubetypes.ConfigMirrorAnnotationKey]; ok && h == hash { + return nil + } + } + return err +} + +// DeleteMirrorPod deletes a mirror pod. +// It takes the full name of the pod and optionally a UID. If the UID +// is non-nil, the pod is deleted only if its UID matches the supplied UID. +// It returns whether the pod was actually deleted, and any error returned +// while parsing the name of the pod. +// Non-existence of the pod or UID mismatch is not treated as an error; the +// routine simply returns false in that case. +func (mc *basicMirrorClient) DeleteMirrorPod(podFullName string, uid *types.UID) (bool, error) { + if mc.apiserverClient == nil { + return false, nil + } + name, namespace, err := kubecontainer.ParsePodFullName(podFullName) + if err != nil { + klog.ErrorS(err, "Failed to parse a pod full name", "podFullName", podFullName) + return false, err + } + + var uidValue types.UID + if uid != nil { + uidValue = *uid + } + klog.V(2).InfoS("Deleting a mirror pod", "pod", klog.KRef(namespace, name), "podUID", uidValue) + + var GracePeriodSeconds int64 + if err := mc.apiserverClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &GracePeriodSeconds, Preconditions: &metav1.Preconditions{UID: uid}}); err != nil { + // Unfortunately, there's no generic error for failing a precondition + if !(apierrors.IsNotFound(err) || apierrors.IsConflict(err)) { + // We should return the error here, but historically this routine does + // not return an error unless it can't parse the pod name + klog.ErrorS(err, "Failed deleting a mirror pod", "pod", klog.KRef(namespace, name)) + } + return false, nil + } + return true, nil +} + +func (mc *basicMirrorClient) getNodeUID() (types.UID, error) { + //node, err := mc.nodeGetter.Get(mc.nodeName) + node, err := mc.apiserverClient.CoreV1().Nodes().Get(context.Background(), mc.nodeName, metav1.GetOptions{}) + if err != nil { + return "", err + } + if node.UID == "" { + return "", fmt.Errorf("UID unset for node %s", mc.nodeName) + } + return node.UID, nil +} + +func getHashFromMirrorPod(pod *v1.Pod) (string, bool) { + hash, ok := pod.Annotations[kubetypes.ConfigMirrorAnnotationKey] + return hash, ok +} + +func getPodHash(pod *v1.Pod) string { + // The annotation exists for all static pods. + return pod.Annotations[kubetypes.ConfigHashAnnotationKey] +} diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/pod/pod_manager.go b/vendor/k8s.io/kubernetes/pkg/kubelet/pod/pod_manager.go index c00759e5e86..2eeb4788af8 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/pod/pod_manager.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/pod/pod_manager.go @@ -56,6 +56,12 @@ type Manager interface { // GetPodByUID provides the (non-mirror) pod that matches pod UID, as well as // whether the pod is found. GetPodByUID(types.UID) (*v1.Pod, bool) + // GetPodByMirrorPod returns the static pod for the given mirror pod and + // whether it was known to the pod manager. + GetPodByMirrorPod(*v1.Pod) (*v1.Pod, bool) + // GetMirrorPodByPod returns the mirror pod for the given static pod and + // whether it was known to the pod manager. + GetMirrorPodByPod(*v1.Pod) (*v1.Pod, bool) // GetPodsAndMirrorPods returns the both regular and mirror pods. GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod) // SetPods replaces the internal pods with the new pods. @@ -69,6 +75,8 @@ type Manager interface { // this means deleting the mappings related to mirror pods. For non- // mirror pods, this means deleting from indexes for all non-mirror pods. DeletePod(pod *v1.Pod) + // GetOrphanedMirrorPodNames returns names of orphaned mirror pods + GetOrphanedMirrorPodNames() []string // TranslatePodUID returns the actual UID of a pod. If the UID belongs to // a mirror pod, returns the UID of its static pod. Otherwise, returns the // original UID. @@ -77,10 +85,14 @@ type Manager interface { // because user may provide a mirror pod UID, which is not recognized by // internal Kubelet functions. TranslatePodUID(uid types.UID) kubetypes.ResolvedPodUID + // GetUIDTranslations returns the mappings of static pod UIDs to mirror pod + // UIDs and mirror pod UIDs to static pod UIDs. + GetUIDTranslations() (podToMirror map[kubetypes.ResolvedPodUID]kubetypes.MirrorPodUID, mirrorToPod map[kubetypes.MirrorPodUID]kubetypes.ResolvedPodUID) // IsMirrorPodOf returns true if mirrorPod is a correct representation of // pod; false otherwise. IsMirrorPodOf(mirrorPod, pod *v1.Pod) bool + MirrorClient } // basicManager is a functional Manager. @@ -106,6 +118,9 @@ type basicManager struct { // basicManager is keeping secretManager and configMapManager up-to-date. secretManager secret.Manager configMapManager configmap.Manager + + // A mirror pod client to create/delete mirror pods. + MirrorClient } // NewBasicPodManager returns a functional Manager. @@ -113,6 +128,7 @@ func NewBasicPodManager(client MirrorClient, secretManager secret.Manager, confi pm := &basicManager{} pm.secretManager = secretManager pm.configMapManager = configMapManager + pm.MirrorClient = client pm.SetPods(nil) return pm } @@ -124,6 +140,9 @@ func (pm *basicManager) SetPods(newPods []*v1.Pod) { pm.podByUID = make(map[kubetypes.ResolvedPodUID]*v1.Pod) pm.podByFullName = make(map[string]*v1.Pod) + pm.mirrorPodByUID = make(map[kubetypes.MirrorPodUID]*v1.Pod) + pm.mirrorPodByFullName = make(map[string]*v1.Pod) + pm.translationByUID = make(map[kubetypes.MirrorPodUID]kubetypes.ResolvedPodUID) pm.updatePodsInternal(newPods...) } @@ -159,9 +178,24 @@ func updateMetrics(oldPod, newPod *v1.Pod) { func (pm *basicManager) updatePodsInternal(pods ...*v1.Pod) { for _, pod := range pods { podFullName := kubecontainer.GetPodFullName(pod) - resolvedPodUID := kubetypes.ResolvedPodUID(pod.UID) - pm.podByUID[resolvedPodUID] = pod - pm.podByFullName[podFullName] = pod + // This logic relies on a static pod and its mirror to have the same name. + // It is safe to type convert here due to the IsMirrorPod guard. + if kubetypes.IsMirrorPod(pod) { + mirrorPodUID := kubetypes.MirrorPodUID(pod.UID) + pm.mirrorPodByUID[mirrorPodUID] = pod + pm.mirrorPodByFullName[podFullName] = pod + if p, ok := pm.podByFullName[podFullName]; ok { + pm.translationByUID[mirrorPodUID] = kubetypes.ResolvedPodUID(p.UID) + } + } else { + resolvedPodUID := kubetypes.ResolvedPodUID(pod.UID) + updateMetrics(pm.podByUID[resolvedPodUID], pod) + pm.podByUID[resolvedPodUID] = pod + pm.podByFullName[podFullName] = pod + if mirror, ok := pm.mirrorPodByFullName[podFullName]; ok { + pm.translationByUID[kubetypes.MirrorPodUID(mirror.UID)] = resolvedPodUID + } + } } } @@ -170,8 +204,16 @@ func (pm *basicManager) DeletePod(pod *v1.Pod) { pm.lock.Lock() defer pm.lock.Unlock() podFullName := kubecontainer.GetPodFullName(pod) - delete(pm.podByUID, kubetypes.ResolvedPodUID(pod.UID)) - delete(pm.podByFullName, podFullName) + // It is safe to type convert here due to the IsMirrorPod guard. + if kubetypes.IsMirrorPod(pod) { + mirrorPodUID := kubetypes.MirrorPodUID(pod.UID) + delete(pm.mirrorPodByUID, mirrorPodUID) + delete(pm.mirrorPodByFullName, podFullName) + delete(pm.translationByUID, mirrorPodUID) + } else { + delete(pm.podByUID, kubetypes.ResolvedPodUID(pod.UID)) + delete(pm.podByFullName, podFullName) + } } func (pm *basicManager) GetPods() []*v1.Pod { @@ -184,7 +226,8 @@ func (pm *basicManager) GetPodsAndMirrorPods() ([]*v1.Pod, []*v1.Pod) { pm.lock.RLock() defer pm.lock.RUnlock() pods := podsMapToPods(pm.podByUID) - return pods, nil + mirrorPods := mirrorPodsMapToMirrorPods(pm.mirrorPodByUID) + return pods, mirrorPods } func (pm *basicManager) GetPodByUID(uid types.UID) (*v1.Pod, bool) { @@ -220,8 +263,53 @@ func (pm *basicManager) TranslatePodUID(uid types.UID) kubetypes.ResolvedPodUID return kubetypes.ResolvedPodUID(uid) } +func (pm *basicManager) GetUIDTranslations() (podToMirror map[kubetypes.ResolvedPodUID]kubetypes.MirrorPodUID, + mirrorToPod map[kubetypes.MirrorPodUID]kubetypes.ResolvedPodUID) { + pm.lock.RLock() + defer pm.lock.RUnlock() + + podToMirror = make(map[kubetypes.ResolvedPodUID]kubetypes.MirrorPodUID, len(pm.translationByUID)) + mirrorToPod = make(map[kubetypes.MirrorPodUID]kubetypes.ResolvedPodUID, len(pm.translationByUID)) + // Insert empty translation mapping for all static pods. + for uid, pod := range pm.podByUID { + if !kubetypes.IsStaticPod(pod) { + continue + } + podToMirror[uid] = "" + } + // Fill in translations. Notice that if there is no mirror pod for a + // static pod, its uid will be translated into empty string "". This + // is WAI, from the caller side we can know that the static pod doesn't + // have a corresponding mirror pod instead of using static pod uid directly. + for k, v := range pm.translationByUID { + mirrorToPod[k] = v + podToMirror[v] = k + } + return podToMirror, mirrorToPod +} + +func (pm *basicManager) GetOrphanedMirrorPodNames() []string { + pm.lock.RLock() + defer pm.lock.RUnlock() + var podFullNames []string + for podFullName := range pm.mirrorPodByFullName { + if _, ok := pm.podByFullName[podFullName]; !ok { + podFullNames = append(podFullNames, podFullName) + } + } + return podFullNames +} + func (pm *basicManager) IsMirrorPodOf(mirrorPod, pod *v1.Pod) bool { - return false + // Check name and namespace first. + if pod.Name != mirrorPod.Name || pod.Namespace != mirrorPod.Namespace { + return false + } + hash, ok := getHashFromMirrorPod(mirrorPod) + if !ok { + return false + } + return hash == getPodHash(pod) } func podsMapToPods(UIDMap map[kubetypes.ResolvedPodUID]*v1.Pod) []*v1.Pod { @@ -231,3 +319,25 @@ func podsMapToPods(UIDMap map[kubetypes.ResolvedPodUID]*v1.Pod) []*v1.Pod { } return pods } + +func mirrorPodsMapToMirrorPods(UIDMap map[kubetypes.MirrorPodUID]*v1.Pod) []*v1.Pod { + pods := make([]*v1.Pod, 0, len(UIDMap)) + for _, pod := range UIDMap { + pods = append(pods, pod) + } + return pods +} + +func (pm *basicManager) GetMirrorPodByPod(pod *v1.Pod) (*v1.Pod, bool) { + pm.lock.RLock() + defer pm.lock.RUnlock() + mirrorPod, ok := pm.mirrorPodByFullName[kubecontainer.GetPodFullName(pod)] + return mirrorPod, ok +} + +func (pm *basicManager) GetPodByMirrorPod(mirrorPod *v1.Pod) (*v1.Pod, bool) { + pm.lock.RLock() + defer pm.lock.RUnlock() + pod, ok := pm.podByFullName[kubecontainer.GetPodFullName(mirrorPod)] + return pod, ok +} diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go b/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go index 00a02a15712..c43cbeb6f14 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/pod_workers.go @@ -72,6 +72,9 @@ type UpdatePodOptions struct { StartTime time.Time // Pod to update. Required. Pod *v1.Pod + // MirrorPod is the mirror pod if Pod is a static pod. Optional when UpdateType + // is kill or terminated. + MirrorPod *v1.Pod // RunningPod is a runtime pod that is no longer present in config. Required // if Pod is nil, ignored if Pod is set. RunningPod *kubecontainer.Pod @@ -215,7 +218,7 @@ type PodWorkers interface { } // the function to invoke to perform a sync (reconcile the kubelet state to the desired shape of the pod) -type syncPodFnType func(ctx context.Context, updateType kubetypes.SyncPodType, pod *v1.Pod, podStatus *kubecontainer.PodStatus) (bool, error) +type syncPodFnType func(ctx context.Context, updateType kubetypes.SyncPodType, pod *v1.Pod, mirrorPod *v1.Pod, podStatus *kubecontainer.PodStatus) (bool, error) // the function to invoke to terminate a pod (ensure no running processes are present) type syncTerminatingPodFnType func(ctx context.Context, pod *v1.Pod, podStatus *kubecontainer.PodStatus, runningPod *kubecontainer.Pod, gracePeriod *int64, podStatusFn func(*v1.PodStatus)) error @@ -944,7 +947,7 @@ func (p *podWorkers) managePodLoop(podUpdates <-chan podWork) { err = p.syncTerminatingPodFn(ctx, pod, status, update.Options.RunningPod, gracePeriod, podStatusFn) default: - isTerminal, err = p.syncPodFn(ctx, update.Options.UpdateType, pod, status) + isTerminal, err = p.syncPodFn(ctx, update.Options.UpdateType, pod, update.Options.MirrorPod, status) } lastSyncTime = time.Now() diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go b/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go index fd6239bd939..3c8d14c9e5a 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/runonce.go @@ -128,7 +128,12 @@ func (kl *Kubelet) runPod(ctx context.Context, pod *v1.Pod, retryDelay time.Dura } klog.InfoS("Pod's containers not running: syncing", "pod", klog.KObj(pod)) - if isTerminal, err = kl.syncPod(context.Background(), kubetypes.SyncPodUpdate, pod, status); err != nil { + klog.InfoS("Creating a mirror pod for static pod", "pod", klog.KObj(pod)) + if err := kl.podManager.CreateMirrorPod(pod); err != nil { + klog.ErrorS(err, "Failed creating a mirror pod", "pod", klog.KObj(pod)) + } + mirrorPod, _ := kl.podManager.GetMirrorPodByPod(pod) + if isTerminal, err = kl.syncPod(ctx, kubetypes.SyncPodUpdate, pod, mirrorPod, status); err != nil { return fmt.Errorf("error syncing pod %q: %v", format.Pod(pod), err) } if retry >= runOnceMaxRetries { diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go b/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go index 3301d53a551..4022b7e806a 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/status/status_manager.go @@ -473,6 +473,8 @@ func (m *manager) updateStatusInternal(pod *v1.Pod, status v1.PodStatus, forceUp cachedStatus, isCached := m.podStatuses[pod.UID] if isCached { oldStatus = cachedStatus.status + } else if mirrorPod, ok := m.podManager.GetMirrorPodByPod(pod); ok { + oldStatus = mirrorPod.Status } else { oldStatus = pod.Status } @@ -631,6 +633,7 @@ func (m *manager) RemoveOrphanedStatuses(podUIDs map[types.UID]bool) { // syncBatch syncs pods statuses with the apiserver. func (m *manager) syncBatch() { var updatedStatuses []podStatusSyncRequest + podToMirror, mirrorToPod := m.podManager.GetUIDTranslations() func() { // Critical section m.podStatusesLock.RLock() defer m.podStatusesLock.RUnlock() @@ -638,13 +641,23 @@ func (m *manager) syncBatch() { // Clean up orphaned versions. for uid := range m.apiStatusVersions { _, hasPod := m.podStatuses[types.UID(uid)] - if !hasPod { + _, hasMirror := mirrorToPod[uid] + if !hasPod && !hasMirror { delete(m.apiStatusVersions, uid) } } for uid, status := range m.podStatuses { syncedUID := kubetypes.MirrorPodUID(uid) + if mirrorUID, ok := podToMirror[kubetypes.ResolvedPodUID(uid)]; ok { + if mirrorUID == "" { + klog.V(5).InfoS("Static pod does not have a corresponding mirror pod; skipping", + "podUID", uid, + "pod", klog.KRef(status.podNamespace, status.podName)) + continue + } + syncedUID = mirrorUID + } if m.needsUpdate(types.UID(syncedUID), status) { updatedStatuses = append(updatedStatuses, podStatusSyncRequest{uid, status}) } else if m.needsReconcile(uid, status.status) { @@ -761,7 +774,7 @@ func (m *manager) needsUpdate(uid types.UID, status versionedPodStatus) bool { } func (m *manager) canBeDeleted(pod *v1.Pod, status v1.PodStatus) bool { - if pod.DeletionTimestamp == nil { + if pod.DeletionTimestamp == nil || kubetypes.IsMirrorPod(pod) { return false } return m.podDeletionSafety.PodResourcesAreReclaimed(pod, status) @@ -783,6 +796,15 @@ func (m *manager) needsReconcile(uid types.UID, status v1.PodStatus) bool { klog.V(4).InfoS("Pod has been deleted, no need to reconcile", "podUID", string(uid)) return false } + // If the pod is a static pod, we should check its mirror pod, because only status in mirror pod is meaningful to us. + if kubetypes.IsStaticPod(pod) { + mirrorPod, ok := m.podManager.GetMirrorPodByPod(pod) + if !ok { + klog.V(4).InfoS("Static pod has no corresponding mirror pod, no need to reconcile", "pod", klog.KObj(pod)) + return false + } + pod = mirrorPod + } podStatus := pod.Status.DeepCopy() normalizeStatus(pod, podStatus) diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go b/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go index ec98c118353..6c7e236fc9a 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/types/pod_update.go @@ -142,7 +142,11 @@ func (sp SyncPodType) String() string { // IsMirrorPod returns true if the passed Pod is a Mirror Pod. func IsMirrorPod(pod *v1.Pod) bool { - return false + if pod.Annotations == nil { + return false + } + _, ok := pod.Annotations[ConfigMirrorAnnotationKey] + return ok } // IsStaticPod returns true if the pod is a static pod. @@ -156,6 +160,9 @@ func IsCriticalPod(pod *v1.Pod) bool { if IsStaticPod(pod) { return true } + if IsMirrorPod(pod) { + return true + } if pod.Spec.Priority != nil && IsCriticalPodBasedOnPriority(*pod.Spec.Priority) { return true } diff --git a/vendor/modules.txt b/vendor/modules.txt index ffcbe9cb92d..6ce9c8f2221 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1372,7 +1372,7 @@ helm.sh/helm/v3/pkg/storage/driver helm.sh/helm/v3/pkg/strvals helm.sh/helm/v3/pkg/time helm.sh/helm/v3/pkg/uploader -# k8s.io/api v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/api v1.26.7-kubeedge1-by +# k8s.io/api v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/api v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -1428,7 +1428,7 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.26.7-kubeedge1-by +# k8s.io/apiextensions-apiserver v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -1438,7 +1438,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/crdserverscheme -# k8s.io/apimachinery v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apimachinery v1.26.7-kubeedge1-by +# k8s.io/apimachinery v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/apimachinery v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -1501,7 +1501,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apiserver v1.26.7-kubeedge1-by +# k8s.io/apiserver v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/apiserver v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/cel @@ -1640,12 +1640,12 @@ k8s.io/apiserver/plugin/pkg/audit/truncate k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook -# k8s.io/cli-runtime v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cli-runtime v1.26.7-kubeedge1-by +# k8s.io/cli-runtime v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/cli-runtime v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/cli-runtime/pkg/genericclioptions k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource -# k8s.io/client-go v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/client-go v1.26.7-kubeedge1-by +# k8s.io/client-go v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/client-go v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -1968,7 +1968,7 @@ k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cloud-provider v1.26.7-kubeedge1-by +# k8s.io/cloud-provider v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/cloud-provider v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/cloud-provider k8s.io/cloud-provider/credentialconfig @@ -1976,12 +1976,12 @@ k8s.io/cloud-provider/service/helpers k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/errors k8s.io/cloud-provider/volume/helpers -# k8s.io/cluster-bootstrap v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.26.7-kubeedge1-by +# k8s.io/cluster-bootstrap v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/cluster-bootstrap/token/api k8s.io/cluster-bootstrap/token/util k8s.io/cluster-bootstrap/util/secrets -# k8s.io/code-generator v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/code-generator v1.26.7-kubeedge1-by +# k8s.io/code-generator v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/code-generator v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen/args @@ -2003,7 +2003,7 @@ k8s.io/code-generator/cmd/lister-gen/args k8s.io/code-generator/cmd/lister-gen/generators k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util -# k8s.io/component-base v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/component-base v1.26.7-kubeedge1-by +# k8s.io/component-base v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/component-base v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/component-base/cli/flag k8s.io/component-base/cli/globalflag @@ -2030,7 +2030,7 @@ k8s.io/component-base/tracing k8s.io/component-base/tracing/api/v1 k8s.io/component-base/version k8s.io/component-base/version/verflag -# k8s.io/component-helpers v0.0.0 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/component-helpers v1.26.7-kubeedge1-by +# k8s.io/component-helpers v0.0.0 => github.com/kubeedge/kubernetes/staging/src/k8s.io/component-helpers v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/component-helpers/apimachinery/lease k8s.io/component-helpers/auth/rbac/validation @@ -2041,17 +2041,17 @@ k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/ephemeral k8s.io/component-helpers/storage/volume -# k8s.io/cri-api v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cri-api v1.26.7-kubeedge1-by +# k8s.io/cri-api v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/cri-api v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/cri-api/pkg/apis k8s.io/cri-api/pkg/apis/runtime/v1 k8s.io/cri-api/pkg/apis/testing k8s.io/cri-api/pkg/errors -# k8s.io/csi-translation-lib v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/csi-translation-lib v1.26.7-kubeedge1-by +# k8s.io/csi-translation-lib v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/csi-translation-lib v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins -# k8s.io/dynamic-resource-allocation v0.0.0 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v1.26.7-kubeedge1-by +# k8s.io/dynamic-resource-allocation v0.0.0 => github.com/kubeedge/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/dynamic-resource-allocation/resourceclaim # k8s.io/gengo v0.0.0-20220902162205-c0856e24416d @@ -2072,7 +2072,7 @@ k8s.io/klog/v2/internal/clock k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity -# k8s.io/kms v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kms v1.26.7-kubeedge1-by +# k8s.io/kms v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/kms v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/kms/apis/v1beta1 k8s.io/kms/apis/v2alpha1 @@ -2101,13 +2101,13 @@ k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/proto/validation k8s.io/kube-openapi/pkg/util/sets k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/kube-scheduler v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kube-scheduler v1.26.7-kubeedge1-by +# k8s.io/kube-scheduler v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/kube-scheduler v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/kube-scheduler/config/v1 k8s.io/kube-scheduler/config/v1beta2 k8s.io/kube-scheduler/config/v1beta3 k8s.io/kube-scheduler/extender/v1 -# k8s.io/kubectl v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kubectl v1.26.7-kubeedge1-by +# k8s.io/kubectl v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/kubectl v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/kubectl/pkg/cmd/util k8s.io/kubectl/pkg/scale @@ -2120,7 +2120,7 @@ k8s.io/kubectl/pkg/util/podutils k8s.io/kubectl/pkg/util/templates k8s.io/kubectl/pkg/util/term k8s.io/kubectl/pkg/validation -# k8s.io/kubelet v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kubelet v1.26.7-kubeedge1-by +# k8s.io/kubelet v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/kubelet v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/kubelet/config/v1 k8s.io/kubelet/config/v1beta1 @@ -2130,7 +2130,7 @@ k8s.io/kubelet/pkg/apis/dra/v1alpha1 k8s.io/kubelet/pkg/apis/pluginregistration/v1 k8s.io/kubelet/pkg/apis/podresources/v1 k8s.io/kubelet/pkg/apis/stats/v1alpha1 -# k8s.io/kubernetes v1.26.7 => github.com/Shelley-BaoYue/kubernetes v1.26.7-kubeedge1-by +# k8s.io/kubernetes v1.26.7 => github.com/kubeedge/kubernetes v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1 k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm @@ -2524,12 +2524,12 @@ k8s.io/kubernetes/test/utils k8s.io/kubernetes/test/utils/image k8s.io/kubernetes/test/utils/kubeconfig k8s.io/kubernetes/third_party/forked/golang/expansion -# k8s.io/legacy-cloud-providers v0.0.0 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.26.7-kubeedge1-by +# k8s.io/legacy-cloud-providers v0.0.0 => github.com/kubeedge/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/legacy-cloud-providers/azure/auth k8s.io/legacy-cloud-providers/gce k8s.io/legacy-cloud-providers/gce/gcpcredential -# k8s.io/mount-utils v0.26.7 => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/mount-utils v1.26.7-kubeedge1-by +# k8s.io/mount-utils v0.26.7 => github.com/kubeedge/kubernetes/staging/src/k8s.io/mount-utils v1.26.7-kubeedge1 ## explicit; go 1.19 k8s.io/mount-utils # k8s.io/pod-security-admission v0.0.0 => k8s.io/pod-security-admission v0.26.7 @@ -2758,38 +2758,38 @@ sigs.k8s.io/yaml # go.etcd.io/etcd/server/v3 => go.etcd.io/etcd/server/v3 v3.5.5 # golang.org/x/sys => golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f # gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2 -# k8s.io/api => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/api v1.26.7-kubeedge1-by -# k8s.io/apiextensions-apiserver => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.26.7-kubeedge1-by -# k8s.io/apimachinery => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apimachinery v1.26.7-kubeedge1-by -# k8s.io/apiserver => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/apiserver v1.26.7-kubeedge1-by -# k8s.io/cli-runtime => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cli-runtime v1.26.7-kubeedge1-by -# k8s.io/client-go => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/client-go v1.26.7-kubeedge1-by -# k8s.io/cloud-provider => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cloud-provider v1.26.7-kubeedge1-by -# k8s.io/cluster-bootstrap => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.26.7-kubeedge1-by -# k8s.io/code-generator => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/code-generator v1.26.7-kubeedge1-by -# k8s.io/component-base => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/component-base v1.26.7-kubeedge1-by -# k8s.io/component-helpers => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/component-helpers v1.26.7-kubeedge1-by -# k8s.io/controller-manager => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/controller-manager v1.26.7-kubeedge1-by -# k8s.io/cri-api => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/cri-api v1.26.7-kubeedge1-by -# k8s.io/csi-api => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/csi-api v1.26.7-kubeedge1-by -# k8s.io/csi-translation-lib => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/csi-translation-lib v1.26.7-kubeedge1-by -# k8s.io/dynamic-resource-allocation => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v1.26.7-kubeedge1-by +# k8s.io/api => github.com/kubeedge/kubernetes/staging/src/k8s.io/api v1.26.7-kubeedge1 +# k8s.io/apiextensions-apiserver => github.com/kubeedge/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.26.7-kubeedge1 +# k8s.io/apimachinery => github.com/kubeedge/kubernetes/staging/src/k8s.io/apimachinery v1.26.7-kubeedge1 +# k8s.io/apiserver => github.com/kubeedge/kubernetes/staging/src/k8s.io/apiserver v1.26.7-kubeedge1 +# k8s.io/cli-runtime => github.com/kubeedge/kubernetes/staging/src/k8s.io/cli-runtime v1.26.7-kubeedge1 +# k8s.io/client-go => github.com/kubeedge/kubernetes/staging/src/k8s.io/client-go v1.26.7-kubeedge1 +# k8s.io/cloud-provider => github.com/kubeedge/kubernetes/staging/src/k8s.io/cloud-provider v1.26.7-kubeedge1 +# k8s.io/cluster-bootstrap => github.com/kubeedge/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.26.7-kubeedge1 +# k8s.io/code-generator => github.com/kubeedge/kubernetes/staging/src/k8s.io/code-generator v1.26.7-kubeedge1 +# k8s.io/component-base => github.com/kubeedge/kubernetes/staging/src/k8s.io/component-base v1.26.7-kubeedge1 +# k8s.io/component-helpers => github.com/kubeedge/kubernetes/staging/src/k8s.io/component-helpers v1.26.7-kubeedge1 +# k8s.io/controller-manager => github.com/kubeedge/kubernetes/staging/src/k8s.io/controller-manager v1.26.7-kubeedge1 +# k8s.io/cri-api => github.com/kubeedge/kubernetes/staging/src/k8s.io/cri-api v1.26.7-kubeedge1 +# k8s.io/csi-api => github.com/kubeedge/kubernetes/staging/src/k8s.io/csi-api v1.26.7-kubeedge1 +# k8s.io/csi-translation-lib => github.com/kubeedge/kubernetes/staging/src/k8s.io/csi-translation-lib v1.26.7-kubeedge1 +# k8s.io/dynamic-resource-allocation => github.com/kubeedge/kubernetes/staging/src/k8s.io/dynamic-resource-allocation v1.26.7-kubeedge1 # k8s.io/gengo v0.0.0 => k8s.io/gengo v0.26.7 # k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1 -# k8s.io/kms => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kms v1.26.7-kubeedge1-by -# k8s.io/kube-aggregator => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kube-aggregator v1.26.7-kubeedge1-by -# k8s.io/kube-controller-manager => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kube-controller-manager v1.26.7-kubeedge1-by -# k8s.io/kube-proxy => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kube-proxy v1.26.7-kubeedge1-by -# k8s.io/kube-scheduler => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kube-scheduler v1.26.7-kubeedge1-by -# k8s.io/kubectl => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kubectl v1.26.7-kubeedge1-by -# k8s.io/kubelet => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/kubelet v1.26.7-kubeedge1-by -# k8s.io/kubernetes => github.com/Shelley-BaoYue/kubernetes v1.26.7-kubeedge1-by -# k8s.io/legacy-cloud-providers => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.26.7-kubeedge1-by -# k8s.io/metrics => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/metrics v1.26.7-kubeedge1-by -# k8s.io/mount-utils => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/mount-utils v1.26.7-kubeedge1-by -# k8s.io/node-api => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/node-api v1.26.7-kubeedge1-by +# k8s.io/kms => github.com/kubeedge/kubernetes/staging/src/k8s.io/kms v1.26.7-kubeedge1 +# k8s.io/kube-aggregator => github.com/kubeedge/kubernetes/staging/src/k8s.io/kube-aggregator v1.26.7-kubeedge1 +# k8s.io/kube-controller-manager => github.com/kubeedge/kubernetes/staging/src/k8s.io/kube-controller-manager v1.26.7-kubeedge1 +# k8s.io/kube-proxy => github.com/kubeedge/kubernetes/staging/src/k8s.io/kube-proxy v1.26.7-kubeedge1 +# k8s.io/kube-scheduler => github.com/kubeedge/kubernetes/staging/src/k8s.io/kube-scheduler v1.26.7-kubeedge1 +# k8s.io/kubectl => github.com/kubeedge/kubernetes/staging/src/k8s.io/kubectl v1.26.7-kubeedge1 +# k8s.io/kubelet => github.com/kubeedge/kubernetes/staging/src/k8s.io/kubelet v1.26.7-kubeedge1 +# k8s.io/kubernetes => github.com/kubeedge/kubernetes v1.26.7-kubeedge1 +# k8s.io/legacy-cloud-providers => github.com/kubeedge/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.26.7-kubeedge1 +# k8s.io/metrics => github.com/kubeedge/kubernetes/staging/src/k8s.io/metrics v1.26.7-kubeedge1 +# k8s.io/mount-utils => github.com/kubeedge/kubernetes/staging/src/k8s.io/mount-utils v1.26.7-kubeedge1 +# k8s.io/node-api => github.com/kubeedge/kubernetes/staging/src/k8s.io/node-api v1.26.7-kubeedge1 # k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.26.7 -# k8s.io/repo-infra => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/repo-infra v1.26.7-kubeedge1-by -# k8s.io/sample-apiserver => github.com/Shelley-BaoYue/kubernetes/staging/src/k8s.io/sample-apiserver v1.26.7-kubeedge1-by +# k8s.io/repo-infra => github.com/kubeedge/kubernetes/staging/src/k8s.io/repo-infra v1.26.7-kubeedge1 +# k8s.io/sample-apiserver => github.com/kubeedge/kubernetes/staging/src/k8s.io/sample-apiserver v1.26.7-kubeedge1 # k8s.io/utils v0.0.0 => k8s.io/utils v0.26.7 # sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.37