https://pulumi.com logo
#kubernetes
Title
# kubernetes
f

few-painting-77267

09/07/2020, 8:07 AM
This is what I tried:
Copy code
new Secret("<>>", {
    metadata: {
        name: "<>",
        namespace: "default"
    },
    stringData: {
        auth: password.result.apply(p => {
            let hash = crypto.createHash('md5');
            hash.update(p);
            return hash.digest('base64')
        }).apply(p => `<>:${p}`)
    }
})
s

salmon-ghost-86211

09/07/2020, 5:04 PM
I have done something like
Copy code
new Secret("<>>", {
    metadata: {
        name: "<>",
        namespace: "default"
    },
    stringData: {
        auth: password.result.apply(p => {
            return Buffer.from(p).toString('base64')
        })
    }
})
f

few-painting-77267

09/07/2020, 6:07 PM
how this is working? where is the user name? and should it be encoded?
g

gorgeous-egg-16927

09/08/2020, 4:38 PM
The
stringData
field is used for raw string data, so you don’t need to b64 encode the input. https://www.pulumi.com/docs/reference/pkg/kubernetes/core/v1/secret/#stringdata_nodejs The
data
field is for b64-encoded input.
f

few-painting-77267

09/09/2020, 5:40 AM
I know, I am using base64 on the hash...
4 Views