straight-arm-50771
10/05/2022, 7:48 PMError: kubernetes:core/v1:Secret is not assignable from {type: string, metadata: {name: string, namespace: string}, data: string}
on Pulumi.yaml line 537:
537: ${dockerHubCredentials}
Cannot assign '{type: string, metadata: {name: string, namespace: string}, data: string}' to 'kubernetes:core/v1:Secret':
data: Cannot assign type 'string' to type 'Map<string>'
# Pulumi.yaml #
variables:
dockerHubCredentials:
Fn::Invoke:
Function: gcp:secretmanager/getSecretVersion:getSecretVersion
Arguments:
secret: k8s_global_dockerhub-regcred
project: myproj
Return: secretData
resources:
regcred:
type: kubernetes:core/v1:Secret
properties:
type: <http://kubernetes.io/dockerconfigjson|kubernetes.io/dockerconfigjson>
metadata:
name: regcred
namespace: some-ns
data:
${dockerHubCredentials}
outputs:
debugRegCred: ${dockerHubCredentials}
# Return #
Outputs:
debugRegCred: {".dockerconfigjson": "my-base64-encoded-config"}
billowy-army-68599
10/05/2022, 8:04 PMdata:
something: ${dockerHubCredentials}
straight-arm-50771
10/05/2022, 8:09 PM${dockerHubCredentials}
, it works.
The pulumi up return recognizes it as a JSON:
Outputs:
debugDeployment: "stage"
debugDomain : "<http://example.com|example.com>"
debugRegCred : (json) {
.dockerconfigjson: "my-base64-encoded-config"
}
helmDeploy : "foo/bar"
k8s : "10.10.10.10"
kubernetes:yaml:ConfigFile
not being available yetbillowy-army-68599
10/05/2022, 8:17 PM.dockerconfigjson
part from the retrieved secret, and only have it return the secret itself, then you can do
.dockerconfigjson: ${dockerHubCredentials}
straight-arm-50771
10/05/2022, 8:19 PM