-
Notifications
You must be signed in to change notification settings - Fork 96
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to create labels with a number as value #337
Comments
as it seems that only the values are going trough safe labels and never the keys (which is weird) 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 |
remove the check for values begining with numbers will fix #337
This reverts commit 9ac86b3. PR 337 changed some code that is used for sanity-checking both Tag and Label names to be too permissive. The rules for Label names are more restrictive than the rules for Tag names, and the change made causes some Labels to be rejected by GCP, resulting in integration test failures like the following: ``` ------------------------------ STEP: creating a VM STEP: locating the VM • Failure [23.037 seconds] VM /tmp/build/e797b25d/bosh-cpi-src/src/bosh-google-cpi/integration/vm_test.go:13 executes the VM lifecycle [It] /tmp/build/e797b25d/bosh-cpi-src/src/bosh-google-cpi/integration/vm_test.go:104 Expected <map[string]string | len:6>: { "director": "val-that-is-definitely-for-sure-absolutely-longer-than-the-al", "job": "job-name", "label-1-key": "label-1-value", "label-2-key": "label-2-value", "name": "val-with-underscores-ending-in-dash", "deployment": "deployment-name", } to be equivalent to <map[string]string | len:7>: { "director": "val-that-is-definitely-for-sure-absolutely-longer-than-the-al", "name": "val-with-underscores-ending-in-dash", "deployment": "deployment-name", "job": "job-name", "index": "n0", "label-1-key": "label-1-value", "label-2-key": "label-2-value", } /tmp/build/e797b25d/bosh-cpi-src/src/bosh-google-cpi/integration/vm_test.go:185 ------------------------------ ```
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:
bosh-google-cpi-release/src/bosh-google-cpi/google/instance_service/labels.go
Line 48 in a089393
A key value pair like:
index:1
is changed toindex:n1
. But it's possible to set the labelindex:1
via GCP API call.The text was updated successfully, but these errors were encountered: