in pkg/utils/ingress/ingress.go [28:51]
func IsGKE(obj interface{}) bool {
ingress := obj.(*v1.Ingress)
if ingress == nil {
klog.Errorf("invalid object type: %T", obj)
return false
}
if ingress.Annotations == nil {
return true // No annotations, treat as GKE Ingress.
}
ingressClass, ok := ingress.Annotations[config.AnnotationIngressClassKey]
if !ok {
return true // Lack of Ingress class annotation, treat as GKE Ingress.
}
if ingressClass == "" || ingressClass == "gce" {
return true // Ingress class is empty or equals „gce”, treat as GKE Ingress.
}
return false // Unknown Ingress class
}