Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always spin up KinD cluster for pulumi-kubernetes-* providers in test step #1235

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
- name: Test Provider Library
run: make test_provider
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- if: failure() && github.event_name == 'push'
Expand Down Expand Up @@ -339,6 +339,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Test Provider Library
run: make test_provider
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- if: failure() && github.event_name == 'push'
Expand Down Expand Up @@ -330,6 +330,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Test Provider Library
run: make test_provider
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- if: failure() && github.event_name == 'push'
Expand Down Expand Up @@ -330,6 +330,11 @@ jobs:
with:
version: v2.5.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Test Provider Library
run: make test_provider
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- if: failure() && github.event_name == 'push'
Expand Down
32 changes: 18 additions & 14 deletions native-provider-ci/src/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1270,20 +1270,24 @@ export function FreeDiskSpace(runner: string): Step {
}

export function CreateKindCluster(provider: string, name: string): Step {
if (
(provider === "kubernetes" ||
provider == "kubernetes-cert-manager" ||
provider == "kubernetes-ingress-nginx") &&
name === "run-acceptance-tests"
) {
return {
name: "Setup KinD cluster",
uses: action.createKindCluster,
with: {
cluster_name: "kind-integration-tests-${{ matrix.language }}",
node_image: "kindest/node:v1.29.2",
},
};
// We always want to create a KinD cluster for any jobs in the "kubernetes-*" providers.
// For "kubernetes" provider, we only create a KinD cluster for the "run-acceptance-tests" job,
// as the other jobs will spin up GKE clusteres for testing.
const step = {
name: "Setup KinD cluster",
uses: action.createKindCluster,
with: {
cluster_name: "kind-integration-tests-${{ matrix.language }}",
node_image: "kindest/node:v1.29.2",
},
};

switch (provider) {
case "kubernetes":
return name === "run-acceptance-tests" ? step : {};
case "kubernetes-cert-manager":
case "kubernetes-ingress-nginx":
return step;
}

return {};
Expand Down
Loading