@@ -103,7 +103,7 @@ JSON looks like below, where the value of `value` is the instance body of the TF
103
103
"vpc_security_group_ids" : ["${aws_security_group.default.id}"],
104
104
"subnet_id": "${aws_subnet.default.id}",
105
105
"tags" : {
106
- "Name " : "web4",
106
+ "name " : "web4",
107
107
"InstancePlugin" : "terraform"
108
108
},
109
109
"connection" : {
@@ -383,8 +383,17 @@ func (p *plugin) Provision(spec instance.Spec) (*instance.ID, error) {
383
383
// set the tags.
384
384
// add a name
385
385
if spec .Tags != nil {
386
- if _ , has := spec .Tags ["Name" ]; ! has {
387
- spec .Tags ["Name" ] = string (id )
386
+ switch properties .Type {
387
+ case "softlayer_virtual_guest" :
388
+ // Set the "name" tag to be lowercase to meet platform requirements
389
+ if _ , has := spec .Tags ["name" ]; ! has {
390
+ spec .Tags ["name" ] = string (id )
391
+ }
392
+ default :
393
+ // Set the first character of the "Name" tag to be uppercase to meet platform requirements
394
+ if _ , has := spec .Tags ["Name" ]; ! has {
395
+ spec .Tags ["Name" ] = string (id )
396
+ }
388
397
}
389
398
}
390
399
@@ -616,7 +625,9 @@ func terraformTags(v interface{}, key string) map[string]string {
616
625
value := fmt .Sprintf ("%v" , v )
617
626
if strings .Contains (value , ":" ) {
618
627
log .Debugln ("terraformTags system tags detected v=" , v )
619
- vv := strings .Split (value , ":" )
628
+ // This assumes that the first colon is separating the key and the value of the tag.
629
+ // This is done so that colons are valid characters in the value.
630
+ vv := strings .SplitN (value , ":" , 2 )
620
631
if len (vv ) == 2 {
621
632
tags [vv [0 ]] = vv [1 ]
622
633
} else {
0 commit comments