diff --git a/examples/examples_ts_test.go b/examples/examples_ts_test.go index 4edf3e2..1536854 100644 --- a/examples/examples_ts_test.go +++ b/examples/examples_ts_test.go @@ -31,9 +31,26 @@ 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 # +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"), + ) + if test.additionalConfig != nil { + for key, value := range test.additionalConfig { + p.SetConfig(t, key, value) + } + } + p.Preview(t, optpreview.ExpectNoChanges()) + }) +} \ No newline at end of file diff --git a/examples/simple-cert-manager-ts/index.ts b/examples/simple-cert-manager-ts/index.ts index b508c28..321b74b 100644 --- a/examples/simple-cert-manager-ts/index.ts +++ b/examples/simple-cert-manager-ts/index.ts @@ -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"); @@ -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: {