-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This should fix #401. As stated in the linked issue, the type for the stateful policy of a managed instance group in the compute module should be a mapping of string and an object that accepts the value for the auto-delete rule (enum). The possible values for the auto-delete rule are `NEVER` and `ON_PERMANENT_INSTANCE_DELETION`. I looked into this briefly and found that the discovery doc for `compute.v1` has the right mapping but my guess is that when generating the schema, the generator is dropping the `$ref` on the `additionalProperties` which turns these into a simple mapping instead of a map of maps. Here's a snippet from the discovery doc on the `master` branch: ```json "StatefulPolicyPreservedState": { "description": "Configuration of preserved resources.", "id": "StatefulPolicyPreservedState", "properties": { "disks": { "additionalProperties": { "$ref": "StatefulPolicyPreservedStateDiskDevice" }, "description": "Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.", "type": "object" }, "externalIPs": { "additionalProperties": { "$ref": "StatefulPolicyPreservedStateNetworkIp" }, "description": "External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.", "type": "object" }, "internalIPs": { "additionalProperties": { "$ref": "StatefulPolicyPreservedStateNetworkIp" }, "description": "Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.", "type": "object" } }, "type": "object" }, ``` And here's the Pulumi schema for `v1`: ```json "google-native:compute/v1:StatefulPolicy": { "properties": { "preservedState": { "type": "object", "$ref": "#/types/google-native:compute/v1:StatefulPolicyPreservedState" } }, "type": "object" }, "google-native:compute/v1:StatefulPolicyPreservedState": { "description": "Configuration of preserved resources.", "properties": { "disks": { "type": "object", "description": "Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks." }, "externalIPs": { "type": "object", "description": "External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name." }, "internalIPs": { "type": "object", "description": "Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name." } }, "type": "object" }, ``` Note how all properties of `StatefulPolicyPreservedState` are missing the additionalProperties definition. (I guess the code generator is defaulting properties of `type: object` without any other attributes as maps?) This PR handles `additionalProperties` for both cases where a property is a map with a primitive value or one where the value is a reference to a type. --------- Co-authored-by: Matthew Jeffryes <[email protected]>
- Loading branch information
1 parent
f36dc4c
commit 551f977
Showing
1,557 changed files
with
134,706 additions
and
13,210 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ sdk/java/gradlew | |
sdk/java/gradlew.bat | ||
|
||
sdk/python/venv | ||
|
||
go.work.sum |
12,002 changes: 10,197 additions & 1,805 deletions
12,002
provider/cmd/pulumi-resource-google-native/metadata.json
Large diffs are not rendered by default.
Oops, something went wrong.
19,506 changes: 19,377 additions & 129 deletions
19,506
provider/cmd/pulumi-resource-google-native/schema.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.