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

Resources don't seem to be adding resource name when created #55

Open
jaxxstorm opened this issue Oct 16, 2022 · 4 comments
Open

Resources don't seem to be adding resource name when created #55

jaxxstorm opened this issue Oct 16, 2022 · 4 comments
Labels
kind/enhancement Improvements or new features

Comments

@jaxxstorm
Copy link

What happened?

Creating OCI resources doesn't appear to be adding the pulumi resource name

Steps to reproduce

Create any resource, for example a VCN

vcn = new oci.core.Vcn(
      "example",
      {
        compartmentId: <someid>,
        cidrBlocks: [<someCidr>],
        
      },
  );

Expected Behavior

I would expect the resulting vcn to be called something like example-<randomstring>

Actual Behavior

It creates a vcn with a set name:

vcn<randomstring>

Output of pulumi about

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).

@jaxxstorm jaxxstorm added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 16, 2022
@lukehoban
Copy link
Member

This resource doesn’t have a name property so doesn’t get auto-naming applied by default.

It’s possible that the displayName property should be autonamed? (Though if it’s truly a display name, also doesn’t seem parricularly necessary to autoname it?)

@jaxxstorm which property did you expect to be autonamed?

@jaxxstorm
Copy link
Author

I think you're right, displayName seems to be the property I expected to have the name appended.

If you're creating something in pulumi called example I'd expect to be able to go into the console and find it based on that name. However currently, just uses the display name <resource>

@guineveresaenger
Copy link
Contributor

I can fix this; we need to set displayName to the autonaming field explicitly on this resource. Example: https://github.com/pulumi/pulumi-confluentcloud/blob/main/provider/resources.go#L82

@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Oct 17, 2022
@guineveresaenger guineveresaenger self-assigned this Oct 17, 2022
@guineveresaenger
Copy link
Contributor

guineveresaenger commented Oct 26, 2022

I missed earlier that it appears this entire provider opts to use displayName for resources where others use name. That's a much more involved fix.

@jaxxstorm it looks like we're hardcoding this here: https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/provider.go#L1356

The override functionality lives here: https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/names.go#L147

I wonder if we should allow displayName as an option for the SetAutoNaming function, since we should probably not assume a default name field. If so, could you open an issue for us in pulumi-terraform-bridge @jaxxstorm ?

@guineveresaenger guineveresaenger removed their assignment Oct 26, 2022
@iwahbe iwahbe added kind/enhancement Improvements or new features and removed kind/bug Some behavior is incorrect or out of spec labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

4 participants