Merge pull request #103048 from gy95/remove_static

remove not used IsStaticPod, prevent possible panic
This commit is contained in:
Kubernetes Prow Robot 2021-08-17 11:41:25 -07:00 committed by GitHub
commit f4185318bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}