remove not used IsStaticPod, prevent possible panic

This commit is contained in:
gy95 2021-06-21 19:38:40 +08:00
parent 513ae557a3
commit 7b98a0770f
2 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -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
}