docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Issues with tags on Softlayer #449

Closed kaufers closed 7 years ago

kaufers commented 7 years ago

The characters that Softlayer supports for tags are limited: http://sldn.softlayer.com/reference/services/SoftLayer_Tag/setTags

The characters permitted are a-z, 0-9, whitespace, _ (underscore), - (hypen), . (period), and : (colon). All other characters will be stripped away.

When the instance-plugin runs terraform, it detects a lot of deltas because the tags (which contains upper case, /, and =) cannot be set:

[WARN] /go/bin/terraform-provider-softlayer overrides an internal plugin for softlayer-provider.
  If you did not expect to see this message you will need to remove the old plugin.
  See https://www.terraform.io/docs/internals/internal-plugins.html
softlayer_virtual_guest.instance-1490622284: Refreshing state... (ID: 29990885)
softlayer_virtual_guest.instance-1490622284: Modifying... (ID: 29990885)
  tags.1516831048: "infrakit.group:workers" => "infrakit.group:workers"
  tags.2007221278: "name:instance-1490622284" => "Name:instance-1490622284"
  tags.2010887493: "" => "infrakit-link:f9Wb2FMIaD9bydoE"
  tags.2048522264: "" => "infrakit-link-context:swarm/cye5nlr6qgfjw33c80e05elnq/worker"
  tags.2127283095: "swarm-id:cye5nlr6qgfjw33c80e05elnq" => "swarm-id:cye5nlr6qgfjw33c80e05elnq"
  tags.2875799547: "infrakit-link-context:swarmcye5nlr6qgfjw33c80e05elnqworker" => ""
  tags.3780940857: "" => "infrakit.config_sha:aUAZntFm4TVOXdsJQUIAbhRezAQ="
  tags.583018450:  "infrakit.config_sha:auazntfm4tvoxdsjquiabhrezaq" => ""
  tags.89971309:   "infrakit-link:f9wb2fmiad9bydoe" => ""
softlayer_virtual_guest.instance-1490622284: Modifications complete (ID: 29990885)
kaufers commented 7 years ago

Chatted with @chungers on this; the proposal is that the supported tag chars will be [a-z][0-9], :, -, and _.

Currently, there is a tag like Name:instance-1490622284 and this will change to:

name:instance-1490622284

Also the / delimiters for this tag infrakit-link-context:swarm/cye5nlr6qgfjw33c80e05elnq/worker will change to use ::, for example:

infrakit-link-context:swarm::cye5nlr6qgfjw33c80e05elnq::worker

The hashing algorithm will only support [a-z][0-9] and : will be reserved for delimiters.

Please verify @chungers, thanks!

chungers commented 7 years ago

@kaufers

The restriction applies to both the name of the tag and the value of the tag, right?

That seems reasonable. There are a couple of places to look:

JacobFrericks commented 7 years ago

Fixed in #461

JacobFrericks commented 7 years ago

@chungers can you close this issue?