Migrate ingress.class annotation to new IngressClassName field

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-03-31 11:14:03 -03:00
parent 461aa93d13
commit 04ef782c57
7 changed files with 46 additions and 27 deletions

View file

@ -190,7 +190,8 @@ func TestCheckIngress(t *testing.T) {
}
t.Run("When the ingress class differs from nginx", func(t *testing.T) {
ing.ObjectMeta.Annotations["kubernetes.io/ingress.class"] = "different"
class := "different"
ing.Spec.IngressClassName = &class
nginx.command = testNginxTestCommand{
t: t,
err: fmt.Errorf("test error"),
@ -201,7 +202,8 @@ func TestCheckIngress(t *testing.T) {
})
t.Run("when the class is the nginx one", func(t *testing.T) {
ing.ObjectMeta.Annotations["kubernetes.io/ingress.class"] = "nginx"
class := "nginx"
ing.Spec.IngressClassName = &class
nginx.command = testNginxTestCommand{
t: t,
err: nil,