mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #103048 from gy95/remove_static
remove not used IsStaticPod, prevent possible panic
This commit is contained in:
commit
f4185318bc
@ -153,12 +153,6 @@ func (mc *basicMirrorClient) getNodeUID() (types.UID, error) {
|
||||
return node.UID, nil
|
||||
}
|
||||
|
||||
// IsStaticPod returns true if the passed Pod is static.
|
||||
func IsStaticPod(pod *v1.Pod) bool {
|
||||
source, err := kubetypes.GetPodSource(pod)
|
||||
return err == nil && source != kubetypes.ApiserverSource
|
||||
}
|
||||
|
||||
func getHashFromMirrorPod(pod *v1.Pod) (string, bool) {
|
||||
hash, ok := pod.Annotations[kubetypes.ConfigMirrorAnnotationKey]
|
||||
return hash, ok
|
||||
|
@ -142,6 +142,9 @@ func (sp SyncPodType) String() string {
|
||||
|
||||
// IsMirrorPod returns true if the passed Pod is a Mirror Pod.
|
||||
func IsMirrorPod(pod *v1.Pod) bool {
|
||||
if pod.Annotations == nil {
|
||||
return false
|
||||
}
|
||||
_, ok := pod.Annotations[ConfigMirrorAnnotationKey]
|
||||
return ok
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user