Skip to content

Commit

Permalink
Promote ingressclass.kubernetes.io/is-default-class annotation to net…
Browse files Browse the repository at this point in the history
…working/v1
  • Loading branch information
Mengjiao Liu committed Jul 9, 2021
1 parent 617064d commit 792665e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func getDefaultClass(lister networkingv1listers.IngressClassLister) (*networking

defaultClasses := []*networkingv1.IngressClass{}
for _, class := range list {
if class.Annotations[networkingv1beta1.AnnotationIsDefaultIngressClass] == "true" {
if class.Annotations[networkingv1.AnnotationIsDefaultIngressClass] == "true" {
defaultClasses = append(defaultClasses, class)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ func TestAdmission(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "default1",
Annotations: map[string]string{
networkingv1beta1.AnnotationIsDefaultIngressClass: "true",
networkingv1.AnnotationIsDefaultIngressClass: "true",
},
},
}
defaultClass2 := &networkingv1.IngressClass{
ObjectMeta: metav1.ObjectMeta{
Name: "default2",
Annotations: map[string]string{
networkingv1beta1.AnnotationIsDefaultIngressClass: "true",
networkingv1.AnnotationIsDefaultIngressClass: "true",
},
},
}
Expand All @@ -63,7 +63,7 @@ func TestAdmission(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "nondefault1",
Annotations: map[string]string{
networkingv1beta1.AnnotationIsDefaultIngressClass: "false",
networkingv1.AnnotationIsDefaultIngressClass: "false",
},
},
}
Expand All @@ -84,7 +84,7 @@ func TestAdmission(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "nondefault2",
Annotations: map[string]string{
networkingv1beta1.AnnotationIsDefaultIngressClass: "",
networkingv1.AnnotationIsDefaultIngressClass: "",
},
},
}
Expand Down

0 comments on commit 792665e

Please sign in to comment.