diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83ee9e4c..3426e00e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,9 @@ jobs: - '7.4' - '8.0' kubernetes: - - '1.17.17' - '1.18.15' - '1.19.7' + - '1.20.2' laravel: - 7.* - 8.* @@ -55,10 +55,10 @@ jobs: path: ~/.composer/cache/files key: composer-php-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.prefer }}-${{ hashFiles('composer.json') }} - - uses: manusa/actions-setup-minikube@v2.2.0 + - uses: manusa/actions-setup-minikube@v2.3.0 name: Setup Minikube with: - minikube version: v1.14.2 + minikube version: v1.17.0 kubernetes version: "v${{ matrix.kubernetes }}" github token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/tests/IngressTest.php b/tests/IngressTest.php index b6c528a6..7ed8364a 100644 --- a/tests/IngressTest.php +++ b/tests/IngressTest.php @@ -22,20 +22,11 @@ class IngressTest extends TestCase 'serviceName' => 'nginx', 'servicePort' => 80, ], + 'pathType' => 'ImplementationSpecific', ]], ], ]]; - public function setUp(): void - { - parent::setUp(); - - // >= v1.18.0: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ - if ($this->cluster->newerThan('1.18.0')) { - self::$rules[0]['http']['paths'][0]['pathType'] = 'ImplementationSpecific'; - } - } - public function test_ingress_build() { $ing = $this->cluster->ingress() @@ -52,28 +43,9 @@ public function test_ingress_build() $this->assertEquals(self::$rules, $ing->getRules()); } - public function test_ingress_from_yaml_pre_1_18_0() - { - if ($this->cluster->newerThan('1.18.0')) { - $this->markTestSkipped('The current tested version is newer than 1.18.0'); - } - - $ing = $this->cluster->fromYamlFile(__DIR__.'/yaml/ingress_pre_1.18.0.yaml'); - - $this->assertEquals('networking.k8s.io/v1beta1', $ing->getApiVersion()); - $this->assertEquals('nginx', $ing->getName()); - $this->assertEquals(['tier' => 'backend'], $ing->getLabels()); - $this->assertEquals(['nginx/ann' => 'yes'], $ing->getAnnotations()); - $this->assertEquals(self::$rules, $ing->getRules()); - } - - public function test_ingress_from_yaml_post_1_18_0() + public function test_ingress_from_yaml_post() { - if ($this->cluster->olderThan('1.18.0')) { - $this->markTestSkipped('The current tested version is older than 1.18.0'); - } - - $ing = $this->cluster->fromYamlFile(__DIR__.'/yaml/ingress_post_1.18.0.yaml'); + $ing = $this->cluster->fromYamlFile(__DIR__.'/yaml/ingress.yaml'); $this->assertEquals('networking.k8s.io/v1beta1', $ing->getApiVersion()); $this->assertEquals('nginx', $ing->getName()); diff --git a/tests/yaml/ingress_post_1.18.0.yaml b/tests/yaml/ingress.yaml similarity index 100% rename from tests/yaml/ingress_post_1.18.0.yaml rename to tests/yaml/ingress.yaml diff --git a/tests/yaml/ingress_pre_1.18.0.yaml b/tests/yaml/ingress_pre_1.18.0.yaml deleted file mode 100644 index 505356a0..00000000 --- a/tests/yaml/ingress_pre_1.18.0.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1beta1 -kind: Ingress -metadata: - name: nginx - labels: - tier: backend - annotations: - nginx/ann: "yes" -spec: - rules: - - host: nginx.test.com - http: - paths: - - path: / - backend: - serviceName: nginx - servicePort: 80