https://pulumi.com logo
Title
l

limited-rainbow-51650

03/24/2021, 9:30 AM
Bumping into a problem with
Promise leak detected
. I have my subclass of ComponentResource for a certain k8s abstraction, containing 2 resources. I pass the
args
unchanged to the second resource. As a bug in my code, I forgot to pass
args.metadata
to the first of my contained resources, mainly to have the correct k8s namespace for this resource as well. But after passing the metadata, I get the
Promise leak detected
. Below is a summary of my component:
export class Service extends pulumi.ComponentResource {

    constructor(name: string, args: kubernetes.core.v1.ServiceArgs, opts?: pulumi.ComponentResourceOptions) {
      super("ng:kubernetes:core:Service", name, {}, opts);
  
      this.backendcfg = new backendconfig.cloud.v1.BackendConfig(
        `${name}-backendconfig`,
        {
          metadata: args.metadata,
          ...
        },
        {
          parent: this,
        }
      )
  
      this.service = new kubernetes.core.v1.Service(
        name,
        args,
        ...
      );
  
  }
b

bored-oyster-3147

03/24/2021, 1:08 PM
for anything other than a
Pulumi.Stack
you must call
this.RegisterResourceOutputs(...)
. Otherwise your promises will not be caught and awaited by the engine, and you'll have leaks
At least.. that has been my understanding.