Bumping into a problem with `Promise leak detected...
# general
l
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:
Copy code
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
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.