@@ -103,7 +103,7 @@ JSON looks like below, where the value of `value` is the instance body of the TF
103103 "vpc_security_group_ids" : ["${aws_security_group.default.id}"],
104104 "subnet_id": "${aws_subnet.default.id}",
105105 "tags" : {
106- "Name " : "web4",
106+ "name " : "web4",
107107 "InstancePlugin" : "terraform"
108108 },
109109 "connection" : {
@@ -383,8 +383,17 @@ func (p *plugin) Provision(spec instance.Spec) (*instance.ID, error) {
383383 // set the tags.
384384 // add a name
385385 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+ }
388397 }
389398 }
390399
@@ -616,7 +625,9 @@ func terraformTags(v interface{}, key string) map[string]string {
616625 value := fmt .Sprintf ("%v" , v )
617626 if strings .Contains (value , ":" ) {
618627 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 )
620631 if len (vv ) == 2 {
621632 tags [vv [0 ]] = vv [1 ]
622633 } else {
0 commit comments