Skip to content

Commit

Permalink
Adding in support for kind config
Browse files Browse the repository at this point in the history
  • Loading branch information
rshade committed Jan 7, 2025
1 parent 2a2f867 commit 419c0f5
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-cert-manager/provider/pkg/version.Version={{.Tag}}
github.com/pulumi/pulumi-kubernetes-cert-manager/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-cert-manager
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-cert-manager/provider/pkg/version.Version={{.Tag}}
github.com/pulumi/pulumi-kubernetes-cert-manager/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-cert-manager
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ builds:
ldflags:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-coredns/provider/pkg/version.Version={{.Tag}}
- -X github.com/pulumi/pulumi-kubernetes-coredns/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-coredns
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ builds:
ldflags:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-coredns/provider/pkg/version.Version={{.Tag}}
- -X github.com/pulumi/pulumi-kubernetes-coredns/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-coredns
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
provider: kubernetes-ingress-nginx
pulumiVersionFile: .pulumi.version
major-version: 0
sdkModuleDir: .
env:
AWS_REGION: us-west-2
PULUMI_TEST_OWNER: moolumi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: kind.config.yml
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: kind.config.yml
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -652,8 +654,11 @@ jobs:
with:
repository: ${{ github.repository }}
base-ref: ${{ github.sha }}
source: .
path: .
source: sdk
path: sdk
version: ${{ steps.version.outputs.version }}
additive: false
files: "**"
files: |-
go.*
go/**
!*.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: kind.config.yml
- name: Run tests
run: >-
set -euo pipefail
Expand Down Expand Up @@ -629,6 +630,7 @@ jobs:
runs-on: ubuntu-latest
name: publish-go-sdk
needs: publish_sdk
if: false
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -652,11 +654,14 @@ jobs:
with:
repository: ${{ github.repository }}
base-ref: ${{ github.sha }}
source: .
path: .
source: sdk
path: sdk
version: ${{ steps.version.outputs.version }}
additive: false
files: "**"
files: |-
go.*
go/**
!*.tar.gz
dispatch_docs_build:
runs-on: ubuntu-latest
needs: publish_go_sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: kind.config.yml
- name: Run tests
run: >-
set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-ingress-nginx/provider/pkg/version.Version={{.Tag}}
github.com/pulumi/pulumi-kubernetes-ingress-nginx/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-ingress-nginx
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- -s
- -w
- -X
github.com/pulumi/pulumi-kubernetes-ingress-nginx/provider/pkg/version.Version={{.Tag}}
github.com/pulumi/pulumi-kubernetes-ingress-nginx/pkg/version.Version={{.Tag}}
binary: pulumi-resource-kubernetes-ingress-nginx
archives:
- name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ jobs:
with:
cluster_name: kind-integration-tests-${{ matrix.language }}
node_image: kindest/node:v1.29.2
config: ""
- name: Run tests
run: cd tests/sdk/${{ matrix.language }} && go test -v -count=1 -cover -timeout
2h -parallel 4 -short ./...
Expand Down
2 changes: 1 addition & 1 deletion native-provider-ci/src/github-workflow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export interface NormalJob {
* You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.
* Expressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.
*/
if?: string;
if?: string | boolean;
/**
* A job contains a sequence of tasks called steps. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the virtual environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job.
*
Expand Down
22 changes: 17 additions & 5 deletions native-provider-ci/src/goreleaser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,26 @@ export class PulumiGoreleaserPreConfig implements GoreleaserConfig {
ignores.push({ goos: "windows", goarch: "arm64" });
}

if (opts["major-version"] > 1) {
if (
[
"kubernetes-cert-manager",
"kubernetes-coredns",
"kubernetes-ingress-nginx"
].includes(opts.provider)
) {
ldflags.push(
`-X github.com/pulumi/pulumi-${opts.provider}/provider/v${opts["major-version"]}/pkg/version.Version={{.Tag}}`
`-X github.com/pulumi/pulumi-${opts.provider}/pkg/version.Version={{.Tag}}`
);
} else {
ldflags.push(
`-X github.com/pulumi/pulumi-${opts.provider}/provider/pkg/version.Version={{.Tag}}`
);
if (opts["major-version"] > 1) {
ldflags.push(
`-X github.com/pulumi/pulumi-${opts.provider}/provider/v${opts["major-version"]}/pkg/version.Version={{.Tag}}`
);
} else {
ldflags.push(
`-X github.com/pulumi/pulumi-${opts.provider}/provider/pkg/version.Version={{.Tag}}`
);
}
}

if (opts.providerVersion !== "") {
Expand Down
4 changes: 4 additions & 0 deletions native-provider-ci/src/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1325,15 +1325,19 @@ export function CreateKindCluster(provider: string, name: string): Step {
with: {
cluster_name: "kind-integration-tests-${{ matrix.language }}",
node_image: "kindest/node:v1.29.2",
config: "",
},
};

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

Expand Down
12 changes: 12 additions & 0 deletions native-provider-ci/src/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,20 @@ export class PublishGoSdkJob implements NormalJob {
name = "publish-go-sdk";
needs = "publish_sdk";
steps: NormalJob["steps"];
if?: string | boolean | undefined;

constructor(opts: WorkflowOpts) {
switch (opts.provider) {
case "kubernetes-cert-manager":
this.if = false;
break;
case "kubernetes-coredns":
this.if = false;
break;
case "kubernetes-ingress-nginx":
this.if = false;
break;
}
this.steps = [
steps.CheckoutRepoStep(),
steps.SetProviderVersionStep(),
Expand Down

0 comments on commit 419c0f5

Please sign in to comment.