rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 657 forks source link

It would be nice if PXE boot kernel parameter values could be wrapped in double quotes #1549

Open william-kerr opened 7 years ago

william-kerr commented 7 years ago

RancherOS Version: v0.8.0-rc5

Where are you running RancherOS? baremetal

I am trying to use danderson/pixiecore to PXE boot RancherOS with an API.

This works:

docker run -it --rm --net=host danderson/pixiecore boot https://github.com/rancher/os/releases/download/v0.8.0-rc5/vmlinuz-4.9.5-rancher https://github.com/rancher/os/releases/download/v0.8.0-rc5/initrd --cmdline='rancher.state.dev=LABEL=RANCHER_STATE rancher.cloud_init.datasources=[url:http://MY_URL:8081/cloud-config.yml]'

This doesn't:

docker run -it --rm --net=host danderson/pixiecore boot https://github.com/rancher/os/releases/download/v0.8.0-rc5/vmlinuz-4.9.5-rancher https://github.com/rancher/os/releases/download/v0.8.0-rc5/initrd --cmdline='rancher.state.dev=LABEL=RANCHER_STATE rancher.cloud_init.datasources="[url:http://MY_URL:8081/cloud-config.yml]"'

Double quotes like these:

rancher.cloud_init.datasources="[url:http://MY_URL:8081/cloud-config.yml]"

Cause RancherOS to throw an error like this:

Failed to parse configuration: Cannot resolve "[url:...]" into <[]string Value> at line...

If my API server returns this response to pixiecore, pixiecore is going to wrap cmdline argument values in quotes:

{
  "kernel":"https://github.com/rancher/os/releases/download/v0.8.0-rc5/vmlinuz-4.9.5-rancher",
  "initrd":["https://github.com/rancher/os/releases/download/v0.8.0-rc5/initrd"],
  "cmdline": {
    "rancher.state.dev":"LABEL=RANCHER_STATE",
    "rancher.cloud_init.datasources":"[url:http://MY_URL:8081/cloud-config.yml]"
  }
}

I have an idea how to work around that limitation, but it would be nice if RancherOS would allow for name="value" or name="[value]".

SvenDowideit commented 7 years ago

quotes have been a nightmare for @joshwget - I don't think we'll have time to work on this until 0.9

joshwget commented 7 years ago

This is basically what #1439 aims to solve. I haven't had a chance to fully evaluate that method yet, but I would like to either use this or so something similar.

william-kerr commented 7 years ago

Thanks for the quick updates! Please take your time and delay this as long as you'd like, and then some. I just wanted to put it out there for you to throw on the back burner.

SvenDowideit commented 7 years ago

I'm really confused by this.

I would not expect key="[url:http://MY_URL:8081/cloud-config.yml]" to be resolved into an array of strings - as its very clearly only a string - and so IMO should error

key=["url:http://MY_URL:8081/cloud-config.yml"] is an array of strings, and so should work and iirc, it does.

william-kerr commented 7 years ago

I think pixiecore was wrapping all key value pairs like key="value". I was trying to avoid having to get pixiecore modified to do something fancy like key=["..."]. That's how this came about. I ended up using a workaround, so I don't personally need this any longer.