cloudfoundry / bosh-google-cpi-release

BOSH Google CPI
Apache License 2.0
63 stars 96 forks source link

Impossible to create labels with a number as value #337

Closed max-soe closed 1 year ago

max-soe commented 1 year ago

GCP not allow that keys of a label starts with a number. But the CPI currently also change values that starting with a number.

Coding: https://github.com/cloudfoundry/bosh-google-cpi-release/blob/a0893932f636403e5524f8d5f4055257a75e2637/src/bosh-google-cpi/google/instance_service/labels.go#L48

A key value pair like: index:1 is changed to index:n1. But it's possible to set the label index:1 via GCP API call.

ramonskie commented 1 year ago

as it seems that only the values are going trough safe labels and never the keys (which is weird) see https://github.com/cloudfoundry/bosh-google-cpi-release/blob/master/src/bosh-google-cpi/google/instance_service/google_instance_set_metadata.go#L66

i think we can safly remove that line.

altough i still think we should look in to why its only checking the values and not the keys as the keys are the one that have restrictions see https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#adding_tag_values