Skip to content
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

Unable to use 'true' and 'false' as label value #23251

Closed
ddysher opened this issue Mar 20, 2016 · 3 comments
Closed

Unable to use 'true' and 'false' as label value #23251

ddysher opened this issue Mar 20, 2016 · 3 comments
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@ddysher
Copy link
Contributor

ddysher commented Mar 20, 2016

It seems resources can't be created with label value set to 'true' or 'false'.

With the following yaml,

  template:
    metadata:
      labels:
        environment: test
        release: false
        tier: frontend

I'm getting error:

$ kubectl create -f replicaset.yaml
unable to decode "replicaset.yaml": [pos 341]: json: expect char '"' but got char 'f'

but change to

  template:
    metadata:
      labels:
        environment: test
        release: stable
        tier: frontend

No error:

$ kubectl create -f replicaset.yaml   
replicaset "replicaset" created

Label documentation doesn't mention this case.

Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.

The use case for using 'true' as label value is to use "Exist", "NotExist" selector, where you don't have a meaningful label value.

I haven't tested yet, but if yaml parser convert it to typed boolean value before we even get the value, then it might not be easy to fix? If so and we don't want to support it, then I'd think we at least document it somehow.

@mwielgus mwielgus added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Mar 21, 2016
@bgrant0607
Copy link
Member

Labels are strings.

@bgrant0607
Copy link
Member

Quote them.

@daikaixian
Copy link

follow @bgrant0607
fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

4 participants