@@ -22,20 +22,11 @@ class IngressTest extends TestCase
2222 'serviceName ' => 'nginx ' ,
2323 'servicePort ' => 80 ,
2424 ],
25+ 'pathType ' => 'ImplementationSpecific ' ,
2526 ]],
2627 ],
2728 ]];
2829
29- public function setUp (): void
30- {
31- parent ::setUp ();
32-
33- // >= v1.18.0: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
34- if ($ this ->cluster ->newerThan ('1.18.0 ' )) {
35- self ::$ rules [0 ]['http ' ]['paths ' ][0 ]['pathType ' ] = 'ImplementationSpecific ' ;
36- }
37- }
38-
3930 public function test_ingress_build ()
4031 {
4132 $ ing = $ this ->cluster ->ingress ()
@@ -52,28 +43,9 @@ public function test_ingress_build()
5243 $ this ->assertEquals (self ::$ rules , $ ing ->getRules ());
5344 }
5445
55- public function test_ingress_from_yaml_pre_1_18_0 ()
56- {
57- if ($ this ->cluster ->newerThan ('1.18.0 ' )) {
58- $ this ->markTestSkipped ('The current tested version is newer than 1.18.0 ' );
59- }
60-
61- $ ing = $ this ->cluster ->fromYamlFile (__DIR__ .'/yaml/ingress_pre_1.18.0.yaml ' );
62-
63- $ this ->assertEquals ('networking.k8s.io/v1beta1 ' , $ ing ->getApiVersion ());
64- $ this ->assertEquals ('nginx ' , $ ing ->getName ());
65- $ this ->assertEquals (['tier ' => 'backend ' ], $ ing ->getLabels ());
66- $ this ->assertEquals (['nginx/ann ' => 'yes ' ], $ ing ->getAnnotations ());
67- $ this ->assertEquals (self ::$ rules , $ ing ->getRules ());
68- }
69-
70- public function test_ingress_from_yaml_post_1_18_0 ()
46+ public function test_ingress_from_yaml_post ()
7147 {
72- if ($ this ->cluster ->olderThan ('1.18.0 ' )) {
73- $ this ->markTestSkipped ('The current tested version is older than 1.18.0 ' );
74- }
75-
76- $ ing = $ this ->cluster ->fromYamlFile (__DIR__ .'/yaml/ingress_post_1.18.0.yaml ' );
48+ $ ing = $ this ->cluster ->fromYamlFile (__DIR__ .'/yaml/ingress.yaml ' );
7749
7850 $ this ->assertEquals ('networking.k8s.io/v1beta1 ' , $ ing ->getApiVersion ());
7951 $ this ->assertEquals ('nginx ' , $ ing ->getName ());
0 commit comments