Skip to content

Commit a3b9576

Browse files
authored
Adding in a golang example (#286)
Golang Example: ``` Previewing update (dev): Type Name Plan + pulumi:pulumi:Stack simple-cert-manager-go-dev create + ├─ kubernetes:core/v1:Namespace sandbox-ns create + ├─ kubernetes-cert-manager:index:CertManager cert-manager create + │ └─ kubernetes:helm.sh/v3:Release cert-manager-helm create + └─ kubernetes:cert-manager.io/v1:Issuer issuer create Outputs: certManagerStatus: output<string> Resources: + 5 to create Updating (dev): Type Name Status + pulumi:pulumi:Stack simple-cert-manager-go-dev created (32s) + ├─ kubernetes:core/v1:Namespace sandbox-ns created (0.03s) + ├─ kubernetes-cert-manager:index:CertManager cert-manager created (31s) + │ └─ kubernetes:helm.sh/v3:Release cert-manager-helm created (31s) + └─ kubernetes:cert-manager.io/v1:Issuer issuer created (0.01s) Outputs: certManagerStatus: { appVersion: "v1.15.3" chart : "cert-manager" name : "cert-manager-helm-fe2f0069" namespace : "sandbox-ns-8ac9bb51" revision : 1 status : "deployed" version : "v1.15.3" } Resources: + 5 created Duration: 39s ```
1 parent ed97a89 commit a3b9576

File tree

6 files changed

+505
-0
lines changed

6 files changed

+505
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ nuget/
1818
ci-scripts/
1919
*.tar.gz
2020
**/*.out
21+
**/out.txt
2122

2223
sdk/dotnet/version.txt
2324
sdk/java/.gradle

examples/examples_go_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//go:build go || all
2+
// +build go all
3+
4+
package examples
5+
6+
import (
7+
"path/filepath"
8+
"testing"
9+
10+
"github.com/pulumi/providertest/pulumitest"
11+
"github.com/pulumi/providertest/pulumitest/opttest"
12+
"github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview"
13+
"github.com/pulumi/pulumi/sdk/v3/go/auto/optrefresh"
14+
)
15+
16+
func TestGoExamples(t *testing.T) {
17+
tests := map[string]struct {
18+
directoryName string
19+
additionalConfig map[string]string
20+
}{
21+
"TestSimpleCertManagerGo": {directoryName: "simple-cert-manager-go"},
22+
}
23+
for name, test := range tests {
24+
t.Run(name, func(t *testing.T) {
25+
p := pulumitest.NewPulumiTest(t, test.directoryName,
26+
opttest.LocalProviderPath("pulumi-kubernetes-cert-manager", filepath.Join(getCwd(t), "..", "bin")),
27+
)
28+
if test.additionalConfig != nil {
29+
for key, value := range test.additionalConfig {
30+
p.SetConfig(t, key, value)
31+
}
32+
}
33+
p.Up(t)
34+
p.Preview(t, optpreview.ExpectNoChanges())
35+
p.Refresh(t, optrefresh.ExpectNoChanges())
36+
})
37+
}
38+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: simple-cert-manager-go
2+
description: A minimal Go Pulumi program
3+
runtime: go
4+
config:
5+
pulumi:tags:
6+
value:
7+
pulumi:template: go
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
module simple-cert-manager-go
2+
3+
go 1.22.4
4+
5+
require (
6+
github.com/pulumi/pulumi-kubernetes-cert-manager/sdk v0.1.1-beta.0
7+
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.19.0
8+
github.com/pulumi/pulumi/sdk/v3 v3.144.1
9+
)
10+
11+
require (
12+
dario.cat/mergo v1.0.0 // indirect
13+
github.com/BurntSushi/toml v1.2.1 // indirect
14+
github.com/Microsoft/go-winio v0.6.1 // indirect
15+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
16+
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
17+
github.com/agext/levenshtein v1.2.3 // indirect
18+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
19+
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
20+
github.com/atotto/clipboard v0.1.4 // indirect
21+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
22+
github.com/blang/semver v3.5.1+incompatible // indirect
23+
github.com/charmbracelet/bubbles v0.16.1 // indirect
24+
github.com/charmbracelet/bubbletea v0.25.0 // indirect
25+
github.com/charmbracelet/lipgloss v0.7.1 // indirect
26+
github.com/cheggaaa/pb v1.0.29 // indirect
27+
github.com/cloudflare/circl v1.3.7 // indirect
28+
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
29+
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
30+
github.com/djherbis/times v1.5.0 // indirect
31+
github.com/emirpasic/gods v1.18.1 // indirect
32+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
33+
github.com/go-git/go-billy/v5 v5.6.1 // indirect
34+
github.com/go-git/go-git/v5 v5.13.1 // indirect
35+
github.com/gogo/protobuf v1.3.2 // indirect
36+
github.com/golang/glog v1.2.2 // indirect
37+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
38+
github.com/google/uuid v1.6.0 // indirect
39+
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
40+
github.com/hashicorp/errwrap v1.1.0 // indirect
41+
github.com/hashicorp/go-multierror v1.1.1 // indirect
42+
github.com/hashicorp/hcl/v2 v2.22.0 // indirect
43+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
44+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
45+
github.com/kevinburke/ssh_config v1.2.0 // indirect
46+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
47+
github.com/mattn/go-isatty v0.0.20 // indirect
48+
github.com/mattn/go-localereader v0.0.1 // indirect
49+
github.com/mattn/go-runewidth v0.0.15 // indirect
50+
github.com/mitchellh/go-ps v1.0.0 // indirect
51+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
52+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
53+
github.com/muesli/cancelreader v0.2.2 // indirect
54+
github.com/muesli/reflow v0.3.0 // indirect
55+
github.com/muesli/termenv v0.15.2 // indirect
56+
github.com/opentracing/basictracer-go v1.1.0 // indirect
57+
github.com/opentracing/opentracing-go v1.2.0 // indirect
58+
github.com/pgavlin/fx v0.1.6 // indirect
59+
github.com/pjbgf/sha1cd v0.3.0 // indirect
60+
github.com/pkg/errors v0.9.1 // indirect
61+
github.com/pkg/term v1.1.0 // indirect
62+
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
63+
github.com/pulumi/esc v0.10.0 // indirect
64+
github.com/rivo/uniseg v0.4.4 // indirect
65+
github.com/rogpeppe/go-internal v1.12.0 // indirect
66+
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
67+
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
68+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
69+
github.com/skeema/knownhosts v1.3.0 // indirect
70+
github.com/spf13/cobra v1.8.0 // indirect
71+
github.com/spf13/pflag v1.0.5 // indirect
72+
github.com/stretchr/objx v0.5.0 // indirect
73+
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
74+
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
75+
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
76+
github.com/xanzy/ssh-agent v0.3.3 // indirect
77+
github.com/zclconf/go-cty v1.13.2 // indirect
78+
go.uber.org/atomic v1.9.0 // indirect
79+
golang.org/x/crypto v0.31.0 // indirect
80+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
81+
golang.org/x/mod v0.19.0 // indirect
82+
golang.org/x/net v0.33.0 // indirect
83+
golang.org/x/sync v0.10.0 // indirect
84+
golang.org/x/sys v0.28.0 // indirect
85+
golang.org/x/term v0.27.0 // indirect
86+
golang.org/x/text v0.21.0 // indirect
87+
golang.org/x/tools v0.23.0 // indirect
88+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
89+
google.golang.org/grpc v1.67.1 // indirect
90+
google.golang.org/protobuf v1.35.1 // indirect
91+
gopkg.in/warnings.v0 v0.1.2 // indirect
92+
gopkg.in/yaml.v3 v3.0.1 // indirect
93+
lukechampine.com/frand v1.4.2 // indirect
94+
)

0 commit comments

Comments
 (0)