The basic structure for how to create a secret see...
# golang
i
The basic structure for how to create a secret seems covered in the reference docs at least https://www.pulumi.com/docs/reference/pkg/kubernetes/core/v1/secret/
r
thanks, as I am not too familiar with Golang so far I struggle a bit with the syntax. e.g. how to provide SecretArgs / Data for the
Copy code
NewSecret(...)
call.
i
i haven’t used pulumi with kubernetes, so there may be more arguments required here, but something like
Copy code
secret, err := core.NewSecret(ctx, "my-secret", &core.SecretArgs{
                        Data: pulumi.StringMap{
                                "key1": pulumi.String("Secret i want to store"),
                        },
                })
assuming you’ve imported the packages as
Copy code
import (
        core "<http://github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1|github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1>"
        "<http://github.com/pulumi/pulumi/sdk/v2/go/pulumi|github.com/pulumi/pulumi/sdk/v2/go/pulumi>"
)
r
👍
worked my way through to the same point, but I think I am getting more familiar 😉
thx Gareth
Are errors in Pulumi typed so I can work with
<http://errors.Is|errors.Is>()
 &
<http://errors.As|errors.As>()
i
not for the most part, no 😞