Skip to content

Commit 17c3577

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 4d2a2ae commit 17c3577

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/types/k8s.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,5 +210,8 @@ func GvkOf(obj any) schema.GroupVersionKind {
210210
}
211211

212212
func GetEffectiveIngressClassName(ingress *netv1.Ingress) string {
213-
return ptr.Deref(ingress.Spec.IngressClassName, ingress.GetAnnotations()[IngressClassNameAnnotation])
213+
if cls := ptr.Deref(ingress.Spec.IngressClassName, ""); cls != "" {
214+
return cls
215+
}
216+
return ingress.GetAnnotations()[IngressClassNameAnnotation]
214217
}

0 commit comments

Comments
 (0)