Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Warnings for Ignored Options on Components #9877

Closed
5 of 6 tasks
RobbieMcKinstry opened this issue Jun 16, 2022 · 0 comments · Fixed by #9921
Closed
5 of 6 tasks

Add Warnings for Ignored Options on Components #9877

RobbieMcKinstry opened this issue Jun 16, 2022 · 0 comments · Fixed by #9921
Assignees
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/S Estimated effort to complete (1-2 days).
Milestone

Comments

@RobbieMcKinstry
Copy link
Contributor

RobbieMcKinstry commented Jun 16, 2022

What happened?

As uncovered in #9704, there are additional resource options that do nothing when applied to components. This issue is to generate warnings for each of them.

Namely, these options are ignored on Components:

Other options that would feasibly have the same behavior, but I was unable to confirm this:

  • deleteBeforeReplace

Steps to reproduce

Here's an example program that demonstrates the problem.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const tags = {
    "issue": "9704",
    "creator": "robbiemckinstry",
    "pulumi": "yes",
};

class OurBucketComponent extends pulumi.ComponentResource {
  public bucket: aws.s3.Bucket;

  constructor(name: string, args: any, opts?: pulumi.ComponentResourceOptions) {
    super("pkg:index:OurBucketComponent", name, args, opts);
    this.bucket = new aws.s3.Bucket(name, {
      tags: args.tags,
      bucket: args.bucketName,
    }, { parent: this });
    
    this.registerOutputs({
      bucketName: this.bucket.id,
    });
  }
}

const args = {
  bucketName: "mckinstry-bug-repro",
  tags: tags,
};

const opts = {
  ignoreChanges: ["root.nested"],
  additionalSecretOutputs: ["bucket"], 
  customTimeouts: {
    create: "1ns",
    update: "1ns",
    destroy: "1ns",
  },
  retainOnDelete: true,
  replaceOnChanges: ["*"],
};

const bucket = new OurBucketComponent("mckinstry-bucket", args, opts);

// Export the bucket names and tags.
export const bucketName = bucket.bucket.id;
export const bucketTags = bucket.bucket.tags;

The resource options applied to OurBucketComponent have no effect.

Expected Behavior

Expected to see a warning in the console if an option is ignored when applied to a Component.

Actual Behavior

No warning, and ignoring options defies average expectations, though this design is intentional.

Versions used

No response

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@RobbieMcKinstry RobbieMcKinstry added kind/bug Some behavior is incorrect or out of spec impact/usability Something that impacts users' ability to use the product easily and intuitively size/S Estimated effort to complete (1-2 days). area/core labels Jun 16, 2022
@RobbieMcKinstry RobbieMcKinstry added this to the 0.74 milestone Jun 16, 2022
@RobbieMcKinstry RobbieMcKinstry self-assigned this Jun 16, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed size/S Estimated effort to complete (1-2 days).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants