-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove newly added id attributes in resources (#102)
As part of #92, new "id" attributes were added to the schema for some of the resources. These are not actually needed since they are part of the plugin sdk by default. These parameters were not required before and "id" is something that is available on *ALL* TF based resources Because we (Pulumi) dervice our schema from your schema (and the plugin SDK) we are getting the following error: ``` sdk/python/bin/build/lib/pulumi_civo/dns_domain_name.py:218: error: Duplicate argument "id" in function definition ``` If the schema needed these, then the make build would fail but it still works ``` ▶ make build ==> Checking that code complies with gofmt requirements... go install ``` You can see from the internals of the plugin SDK (helper/schema/resource_data.go), the following func: ``` // SetId sets the ID of the resource. If the value is blank, then the // resource is destroyed. func (d *ResourceData) SetId(v string) { d.once.Do(d.init) d.newState.ID = v // once we transition away from the legacy state types, "id" will no longer // be a special field, and will become a normal attribute. // set the attribute normally d.setWriter.unsafeWriteField("id", v) // Make sure the newState is also set, otherwise the old value // may get precedence. if d.newState.Attributes == nil { d.newState.Attributes = map[string]string{} } d.newState.Attributes["id"] = v } ``` So when you use d.SetID, it actually creates the ID attribute for you
- Loading branch information
Showing
10 changed files
with
0 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters