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

nodeselector keyvalues are not parsed properly for kubernetes driver #617

Open
MichalAugustyn opened this issue May 23, 2021 · 1 comment
Labels
area/driver/kubernetes kind/bug Something isn't working

Comments

@MichalAugustyn
Copy link

Issue description

Based on the docs, it should be possible to pass multiple nodeselector keyvalues using

nodeselector="label1=value1,label2=value2"

By quoting the nodeselector value, it should be parsed with this line becoming a list of keyvalues.

It seems that the second keyvalue, label2 in this case, is treated as another driver-opt rather than a keyvalue for nodeselector. It might be caused by the way driver-opts are parsed (using csvToMap func).

Reproducing the issue

$ docker buildx create --driver kubernetes --driver-opt replicas=1,nodeselector="kubernetes.io/arch=arm64,kubernetes.io/arch=arm" --use
unruffled_elion
$ touch Dockerfile
$ docker buildx build . 
[+] Building 0.0s (0/0)                                                                                                                                                                       
error: no valid drivers found: invalid driver option kubernetes.io/arch for driver kubernetes
@odinsy
Copy link

odinsy commented Dec 22, 2022

same problem here, multiple labels doesn't work

$ docker buildx create --use --bootstrap --name kube --driver=kubernetes --platform=linux/amd64 --node=builder-amd64 --driver-opt=namespace=gitlab,nodeselector="kubernetes.io/arch=amd64,app=gitlab-runner"
ERROR: failed to initialize builder kube (builder-amd64): invalid driver option app for driver kubernetes

buildx version

$ docker buildx version
github.com/docker/buildx v0.9.1 ed00243a0ce2a0aee75311b06e32d33b44729689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/driver/kubernetes kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants