I am trying to create a Secret using Pulumi k8s: `...
# general
f
I am trying to create a Secret using Pulumi k8s:
Copy code
new k8s.core.v1.Secret("foo-test", {
    metadata: {
        name: "foo-test"
    },
    data: {
        key: "asd123"
    },
    type: "Opaque"
}, {provider: k8sProvider});
and have been getting
Copy code
error: Plan apply failed: Secret in version "v1" cannot be handled as a Secret: v1.Secret.ObjectMeta: v1.ObjectMeta.TypeMeta: Kind: Data: decode base64: illegal base64 data at input byte 4, error found in #10 byte of ...|":"asd123"},"kind":"|..., bigger context ...|{"apiVersion":"v1","data":{"key":"asd123"},"kind":"Secret","metadata":{"labels":{"app.kuber|...
I can create the secret from the CLI just fine.
m
cc @gorgeous-egg-16927
c
@full-dress-10026 that data does not appear to encode printable characters, and that error means that the API server rejected the secret as a result.
If that’s the string you want, you have to base64 encode it.
If you’re running on some kind of unix, try:
Copy code
echo -n 'asd123' | base64
not sure what oyu mean when you say you can create it from the CLI though.
f
That answered my question. Thanks!