Skip to content

Commit 6724d5b

Browse files
fix: update label field to match latest version
Update GCE label field to match latest rancher-machine version #1580 Co-authored-by: Harrison <harrisonaffel@gmail.com>
1 parent 84d02cc commit 6724d5b

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/resources/machine_config_v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ The following attributes are exported:
343343
* `disk_type` - (Required) GCE Instance Disk Type (string)
344344
* `external_firewall_rule_prefix` - (Optional) A prefix to be added to firewall rules created when exposing ports publicly. Required if exposing ports publicly via the `open_port` field. (string)
345345
* `internal_firewall_rule_prefix` - (Optional) A prefix to be added to an internal firewall rule created to ensure virtual machines can communicate with one another. Omitting this field will result in an internal firewall rule not being created. (string)
346-
* `labels` - (Optional) A set of labels to be added to each VM, in the format of 'key1,value1,key2,value2' (string)
346+
* `vm_labels` - (Optional) A set of labels to be added to each VM, in the format of 'key1,value1,key2,value2' (string)
347347
* `machine_image` - (Required) GCE instance image absolute URL (string)
348348
* `machine_type` - (Required) GCE instance type (string)
349349
* `network` - (Required) The network to provision virtual machines within (string)

rancher2/schema_machine_config_v2_googlegce.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func machineConfigV2GoogleGCEFields() map[string]*schema.Schema {
3535
Optional: true,
3636
Description: "A prefix to be added to an internal firewall rule created to ensure virtual machines can communicate with one another.",
3737
},
38-
"labels": {
38+
"vm_labels": {
3939
Type: schema.TypeString,
4040
Optional: true,
4141
Description: "A set of labels to be added to each VM, in the format of 'key1,value1,key2,value2'",

rancher2/structure_machine_config_v2_googlegce.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type machineConfigV2GoogleGCE struct {
2020
DiskType string `json:"diskType,omitempty" yaml:"diskType,omitempty"`
2121
ExternalFirewallRulePrefix string `json:"externalFirewallRulePrefix,omitempty" yaml:"externalFirewallRulePrefix,omitempty"`
2222
InternalFirewallRulePrefix string `json:"internalFirewallRulePrefix,omitempty" yaml:"internalFirewallRulePrefix,omitempty"`
23-
Labels string `json:"labels,omitempty" yaml:"labels,omitempty"`
23+
VMLabels string `json:"vmLabels,omitempty" yaml:"vmLabels,omitempty"`
2424
MachineImage string `json:"machineImage,omitempty" yaml:"machineImage,omitempty"`
2525
MachineType string `json:"machineType,omitempty" yaml:"machineType,omitempty"`
2626
Network string `json:"network,omitempty" yaml:"network,omitempty"`
@@ -73,8 +73,8 @@ func flattenMachineConfigV2GoogleGCE(in *MachineConfigV2GoogleGCE) []interface{}
7373
obj["internal_firewall_rule_prefix"] = in.InternalFirewallRulePrefix
7474
}
7575

76-
if len(in.Labels) > 0 {
77-
obj["labels"] = in.Labels
76+
if len(in.VMLabels) > 0 {
77+
obj["vm_labels"] = in.VMLabels
7878
}
7979

8080
if len(in.MachineImage) > 0 {
@@ -177,8 +177,8 @@ func expandMachineConfigV2GoogleGCE(p []interface{}, source *MachineConfigV2) *M
177177
obj.InternalFirewallRulePrefix = v
178178
}
179179

180-
if v, ok := in["labels"].(string); ok && len(v) > 0 {
181-
obj.Labels = v
180+
if v, ok := in["vm_labels"].(string); ok && len(v) > 0 {
181+
obj.VMLabels = v
182182
}
183183

184184
if v, ok := in["machine_image"].(string); ok && len(v) > 0 {

0 commit comments

Comments
 (0)