Benjamin S. Allen
bfa2592538
Support More Complex Cmdline Configuration
...
Fixes #2755 . Allows for quoted arguments with spaces in the kernel cmdline to be parsed properly.
An example command line:
```
$ cat /proc/cmdline
earlyprintk=serial console=ttyS0 rancher.autologin=ttyS0 rancher.defaults.hostname=ros-vm1 rancher.defaults.network.dns.nameservers=[192.168.64.1] rancher.network.interfaces.eth0.dhcp=true rancher.network.interfaces.eth1.dhcp=false rancher.network.interfaces.eth1.address=192.168.99.11/24 rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/vda] rancher.state.formatzero cc.ssh_authorized_keys=['ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOz8mD0tRrNsHBLHD5jVgmXO26JA7eKFZrj4Ic9KR2y3qXlxU9JCYYn/qDyTCmExt8Rw6SaU/BvgU7WT3Bjsi6c=','ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJj5mkpBHBBAW5XClcB5aFTWph+VCL7I0W8gm93AT5w4','ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKfb0O2qXgIgrtD5Mj7fBYdg4jMrT7wetBbkG2e4maDsRR3AtSYjEB3NeEifM8gdvIf0gYs1BNB/Ar76agaQGeqW+Ewb2LWdypr4Ipw09yWCrC9ttVbCnHuzVLYjML0CNgpjIRC+FC5r1X1gm2LufRN4orZ1NQvNhRRWJVT37vRtHo79TecK0DKQmy87Zpj3cNiI/5iObnTk56pZWpIAEiC5hEVkcVxmdkLJs3YonWVZzmK/Y8uvFtF+GhA6Jcpc38zDQHKsOjFWvj3qbWtVEQteNDxsM2pNeXY5wdrhRn4YSdKme9Cm7CdAogIdAdPtqPIfq/jY0QczS12qFZH7zt']
```
Results in:
```
$ sudo ros config export
rancher:
defaults:
hostname: ros-vm1
network:
dns:
nameservers:
- 192.168.64.1
environment:
EXTRA_CMDLINE: /init AAAAC3NzaC1lZDI1NTE5AAAAIJj5mkpBHBBAW5XClcB5aFTWph+VCL7I0W8gm93AT5w4','ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKfb0O2qXgIgrtD5Mj7fBYdg4jMrT7wetBbkG2e4maDsRR3AtSYjEB3NeEifM8gdvIf0gYs1BNB/Ar76agaQGeqW+Ewb2LWdypr4Ipw09yWCrC9ttVbCnHuzVLYjML0CNgpjIRC+FC5r1X1gm2LufRN4orZ1NQvNhRRWJVT37vRtHo79TecK0DKQmy87Zpj3cNiI/5iObnTk56pZWpIAEiC5hEVkcVxmdkLJs3YonWVZzmK/Y8uvFtF+GhA6Jcpc38zDQHKsOjFWvj3qbWtVEQteNDxsM2pNeXY5wdrhRn4YSdKme9Cm7CdAogIdAdPtqPIfq/jY0QczS12qFZH7zt']
network:
interfaces:
eth0:
dhcp: true
eth1:
address: 192.168.99.11/24
dhcp: false
state:
autoformat:
- /dev/vda
dev: LABEL=RANCHER_STATE
formatzero: true
ssh_authorized_keys:
- ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOz8mD0tRrNsHBLHD5jVgmXO26JA7eKFZrj4Ic9KR2y3qXlxU9JCYYn/qDyTCmExt8Rw6SaU/BvgU7WT3Bjsi6c=
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJj5mkpBHBBAW5XClcB5aFTWph+VCL7I0W8gm93AT5w4
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKfb0O2qXgIgrtD5Mj7fBYdg4jMrT7wetBbkG2e4maDsRR3AtSYjEB3NeEifM8gdvIf0gYs1BNB/Ar76agaQGeqW+Ewb2LWdypr4Ipw09yWCrC9ttVbCnHuzVLYjML0CNgpjIRC+FC5r1X1gm2LufRN4orZ1NQvNhRRWJVT37vRtHo79TecK0DKQmy87Zpj3cNiI/5iObnTk56pZWpIAEiC5hEVkcVxmdkLJs3YonWVZzmK/Y8uvFtF+GhA6Jcpc38zDQHKsOjFWvj3qbWtVEQteNDxsM2pNeXY5wdrhRn4YSdKme9Cm7CdAogIdAdPtqPIfq/jY0QczS12qFZH7zt
```
2019-08-30 07:10:55 +08:00
niusmallnan
823ae28a52
Imports are organized in groups, with blank lines between them
...
https://github.com/golang/go/wiki/CodeReviewComments#imports
2018-10-23 13:11:31 +08:00
Darren Shepherd
1f50386828
Move around code for better clarity
2018-09-19 17:18:49 +08:00
niusmallnan
b4cd6af468
Update all go files mode
2018-04-16 11:30:08 +08:00
Sven Dowideit
38ac3b05fb
fix tests
...
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-08-17 09:31:52 +10:00
Sven Dowideit
f793518aa6
Get RancherOS logging to throw debug logs to a remote syslog server when the kernel netconsole is configured
...
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-08-17 08:42:37 +10:00
Sven Dowideit
f6ce1f0685
Use the kernel cmdline elide patch to load config into RancherOS that isn't visible in /pro/cmdline
...
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-03-14 14:19:43 +10:00
Josh Curl
c6232e67aa
Allow question marks in unquoted kernel parameters
2017-01-04 16:34:40 -08:00
Darren Shepherd
5987d713a4
Merge pull request #1245 from joshwget/parse-colons-without-quotes
...
Colons can be parsed without quotes
2016-09-26 21:41:57 -07:00
Josh Curl
b65e429bb6
Run gofmt and fix vet errors
2016-09-26 21:32:37 -07:00
Josh Curl
c1582f5a49
Colons can be parsed without quotes
2016-09-18 16:35:32 -07:00
Josh Curl
2781eab500
Split up parseCmdline unit test
2016-09-18 16:33:22 -07:00
Ivan Mikushin
22887dfb0b
Unescape kernel params
...
so kernel params like rancher.cloud_init.datasources='["url:http://10.0.2.2:8800/cc.yml "]' could be used
2016-07-15 15:03:17 -07:00
Josh Curl
55d629b980
Remove unneeded service processing code
2016-06-02 09:01:00 -07:00
Josh Curl
95d8ebe146
Simplify configuration
2016-05-31 14:34:04 -07:00
Josh Curl
53acef17cd
Use yaml.Unmarshal to handle config arguments
2016-04-14 17:04:00 -07:00
Josh Curl
b52663ee5f
Fix config/config_test.go
2016-04-13 10:26:41 -07:00
Ivan Mikushin
66ba159482
Pre-process YAML config data
...
Stringify libcompose datatypes' leaf values to avoid unmarshaling errors, even on somewhat incorrect input data: like using bools or numerics in labels.
2015-12-07 23:30:16 +05:00
Ivan Mikushin
5a363ab97d
migrate to upstream libcompose in one and a half go
2015-12-07 18:17:57 +05:00
Wang Long
9e15059789
Replace rancherio with rancher
...
Signed-off-by: Wang Long <long.wanglong@huawei.com>
2015-10-12 19:50:57 +08:00
Ivan Mikushin
338abb758f
Reshuffle cloud-config
...
Read files cloud-config.d in alphanumeric order, then cloud-config.yml
`ros config` writes to cloud-config.yml (and cloud-config.d/private.yml - only private keys)
Add (c *CloudConfig) Save() method, use it to save the changed config
Read and apply metadata as part of LoadConfig()
Simplify ros config export logic
2015-09-30 23:59:22 +05:00
Ivan Mikushin
5934852e80
rename rancher.user_docker to rancher.docker in cloud-config
2015-09-14 11:50:39 +05:00
Ivan Mikushin
4d6530be73
slices union and intersection
...
useful for merging and splitting configs
2015-08-21 17:07:45 +05:00
Ivan Mikushin
7ad60c07bd
make cloud-config the configuration mechanism for RancherOS
2015-08-05 19:48:25 +05:00
Ivan Mikushin
dff70f8362
latest rancher-compose, default.go -> os-config.yml
...
also, gofmt
2015-06-29 12:00:41 +05:00
Darren Shepherd
3756bbae90
Reliably merge the yaml maps data
2015-03-18 06:45:22 -07:00
Darren Shepherd
ac2459ba37
Refactor configuration
2015-03-18 06:45:21 -07:00
Darren Shepherd
bcf66e4c93
Refactor configuration structure
2015-02-14 09:29:07 -07:00
Darren Shepherd
df4a126175
Initial commit
2015-02-08 21:38:37 -07:00