Skip to content

Label Selector only works with one key/value pair #381

@lizardruss

Description

@lizardruss

What happened?
An error occurs when using more than one key/value pair as a label selector for port forwarding.

Error:
Unable to start portforwarding: Unable to list devspace pods: found ',', expected: !, identifier, or 'end of string'

Example Configuration:

ports:
- labelSelector:
    app: redis-ha
    redis-role: master
  portMappings:
  - localPort: 6379
    remotePort: 6379

What did you expect to happen instead?
I expected portforwarding to start and match the pod on multiple labels.

How can we reproduce the bug? (as minimally and precisely as possible)
Use multiple key/value pairs in a labelSelector and run devspace up. See "Example Configuration" above.

Local Environment:

  • Operating System: mac
  • Deployment method: helm

Kubernetes Cluster:

  • Cloud Provider: local
  • Kubernetes Version: [use kubectl version]
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T21:12:46Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.5", GitCommit:"32ac1c9073b132b8ba18aa830f46b77dcceb0723", GitTreeState:"clean", BuildDate:"2018-06-21T11:34:22Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Anything else we need to know?
This occurred with the stable/redis-ha@2.2.3 chart. With that version of the chart, there are several nodes labeled as master or slave, but only the master pods can be written to. I've upgrade to the 3.0 version of the chart, which has a different deployment model, but this issue would occur with any pod that needs multiple labels to be uniquely identified.

/kind bug

Metadata

Metadata

Assignees

Labels

area/devIssues related to devspace devkind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions