Migrate ingress.class annotation to new IngressClassName field
This commit is contained in:
parent
461aa93d13
commit
04ef782c57
7 changed files with 46 additions and 27 deletions
|
|
@ -949,12 +949,22 @@ func toIngress(obj interface{}) (*networkingv1beta1.Ingress, bool) {
|
|||
return nil, false
|
||||
}
|
||||
|
||||
ing.Spec.IngressClassName = extractClassName(ing)
|
||||
return ing, true
|
||||
}
|
||||
|
||||
if ing, ok := obj.(*networkingv1beta1.Ingress); ok {
|
||||
ing.Spec.IngressClassName = extractClassName(ing)
|
||||
return ing, true
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func extractClassName(ing *networkingv1beta1.Ingress) *string {
|
||||
if c, ok := ing.Annotations[class.IngressKey]; ok {
|
||||
return &c
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue