https://pulumi.com logo
Title
e

echoing-angle-67526

06/01/2022, 10:00 PM
Hello, i'm disabled the default k8s provider, and now i'm getting the following error when running the code below:
let secrets: pulumi.Output<output.core.v1.ObjectReference[]> = k8s.core.v1.ServiceAccount.get("ksa-".concat(ksa.name),resourceId).secrets;
error: Error: failed to read resource #thx/shared-db-password 'ksa-shared-db-password' [kubernetes:core/v1:ServiceAccount]: 2 UNKNOWN: Default provider for 'kubernetes:core/v1:ServiceAccount' disabled. 'kubernetes:core/v1:ServiceAccount' must use an explicit provider.
looking at the
k8s.core.v1.ServiceAccount.get
api it doesn't allow you to set the k8s provider. i believe this is the same issue as https://github.com/pulumi/pulumi-kubernetes/issues/1945 ?
g

gorgeous-egg-16927

06/02/2022, 7:33 PM
You should be able to set the provider on the resource options. Something like this:
let secrets: pulumi.Output<output.core.v1.ObjectReference[]> = k8s.core.v1.ServiceAccount.get("ksa-".concat(ksa.name),resourceId, {provider: myProvider}).secrets;
👍 1
e

echoing-angle-67526

06/02/2022, 7:47 PM
@gorgeous-egg-16927 i didn't look at the type definition very carefully but this is exactly what i was looking for. thanks!
👍 2