Skip to content

Commit

Permalink
Adding in preview test
Browse files Browse the repository at this point in the history
  • Loading branch information
rshade committed Dec 23, 2024
1 parent 25a9549 commit 8a44600
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions examples/examples_ts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,21 @@ func TestTsExamples(t *testing.T) {
p.SetConfig(t, key, value)
}
}
p.SetConfig(t, "repository", "public.ecr.aws/eks-anywhere-dev/cert-manager/cert-manager-controller")
p.Up(t)
p.Preview(t, optpreview.ExpectNoChanges())
p.Refresh(t, optrefresh.ExpectNoChanges())
})
}
}

// This tests the Output being passed to repository to fix #133
func TestTsCertManagerPreview(t *testing.T) {
t.Run("TestSimpleCertManagerTsPreview", func(t *testing.T) {
p := pulumitest.NewPulumiTest(t, "simple-cert-manager-ts",
opttest.LocalProviderPath("pulumi-kubernetes-cert-manager", filepath.Join(getCwd(t), "..", "bin")),
opttest.YarnLink("@pulumi/kubernetes-cert-manager"),
)
p.Preview(t, optpreview.ExpectNoChanges())
})
}
11 changes: 9 additions & 2 deletions examples/simple-cert-manager-ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import * as k8s from "@pulumi/kubernetes";
import * as certmanager from "@pulumi/kubernetes-cert-manager";
import * as random from "@pulumi/random";
import * as pulumi from "@pulumi/pulumi"

const randomString = new random.RandomString("random", {
length: 16,
special: true,
overrideSpecial: "/@£$",
})

const conf = new pulumi.Config()
const confRepo = conf.get("repository")
let repository = randomString.result
if (confRepo) {
repository = pulumi.output(confRepo)
}

// Create a sandbox namespace.
const ns = new k8s.core.v1.Namespace("sandbox-ns");

Expand All @@ -19,7 +26,7 @@ const manager = new certmanager.CertManager("cert-manager", {
version: "v1.15.3",
},
image: {
repository: randomString.result.apply(result => "public.ecr.aws/eks-anywhere-dev/cert-manager/cert-manager-controller"),
repository,
tag: "v1.15.3-eks-a-v0.21.3-dev-build.0"
},
cainjector: {
Expand Down

0 comments on commit 8a44600

Please sign in to comment.