mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Unescape kernel params
so kernel params like rancher.cloud_init.datasources='["url:http://10.0.2.2:8800/cc.yml"]' could be used
This commit is contained in:
@@ -90,3 +90,13 @@ func TestMerge(t *testing.T) {
|
||||
}
|
||||
assert.Equal(expected, Merge(m0, m1))
|
||||
}
|
||||
|
||||
func TestCmdLineStr(t *testing.T) {
|
||||
assert := require.New(t)
|
||||
|
||||
cmdLine := `rancher.cloud_init.datasources=[\'url:http://192.168.1.100/cloud-config\']`
|
||||
assert.Equal("rancher.cloud_init.datasources=['url:http://192.168.1.100/cloud-config']", UnescapeKernelParams(cmdLine))
|
||||
|
||||
cmdLine = `rancher.cloud_init.datasources=[\"url:http://192.168.1.100/cloud-config\"]`
|
||||
assert.Equal(`rancher.cloud_init.datasources=["url:http://192.168.1.100/cloud-config"]`, UnescapeKernelParams(cmdLine))
|
||||
}
|
||||
|
Reference in New Issue
Block a user