Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -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 }}"

Expand Down
34 changes: 3 additions & 31 deletions tests/IngressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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());
Expand Down
File renamed without changes.
17 changes: 0 additions & 17 deletions tests/yaml/ingress_pre_1.18.0.yaml

This file was deleted.