faint-motherboard-95438
01/02/2019, 6:28 PMpulumi.ComponentResource
, let’s call it MyComponent
, creating in its constructor
a k8s.core.v1.ConfigMap
and a k8s.helm.v2.Chart
the former getting a direct reference to it in the later values
args.
Both have their opts
like { parent: this }
, this
obviously referencing MyComponent
.
MyComponent
is called with opts
like { providers: { kubernetes: k8sProvider /* a working k8s.Provider instance */ } }
In this situation I get this error : error: Error: Explicit providers may not be used with component resources
Where things get weirder is that if I remove opts
along with the parent reference from the ConfigMap
(and only from this one), the error disappear.
I tracked down the error in pulumi.ComponentResource
:
if (opts.provider !== undefined) {
throw new errors_1.ResourceError("Explicit providers may not be used with component resources", opts.parent);
}
That does not make any sense for me in this situation, I don’t even set an opts.provider
anywhere.
Is this intended (and if so I could use some help to understand it) or should I open an issue ?white-balloon-205
opts
from the component down into a child somewhere - like opts: opts
or opts: {...opts, parent: this}
. I've seen this error when I accidentally did this.
I'm hoping we'll be able to clean up some of the error case here as part of https://github.com/pulumi/pulumi/issues/1802, I'll add a note referencing this specific issue to that.faint-motherboard-95438
01/02/2019, 7:52 PM{ parent: this }
is passed down explicitly to each child of my component.white-balloon-205
faint-motherboard-95438
01/02/2019, 7:54 PM