Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
cli: do not set ip based kernel parameter
Browse files Browse the repository at this point in the history
For one thing, it is not used by any kata components. For another thing,
it breaks vm factory hypervisor config check.

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Jul 19, 2018
1 parent 0309e59 commit 7cdc0fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 3 additions & 8 deletions cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,8 @@ var systemdKernelParam = []vc.Param{
},
}

func getKernelParams(containerID string, needSystemd bool) []vc.Param {
p := []vc.Param{
{
Key: "ip",
Value: fmt.Sprintf("::::::%s::off::", containerID),
},
}
func getKernelParams(needSystemd bool) []vc.Param {
p := []vc.Param{}

if needSystemd {
p = append(p, systemdKernelParam...)
Expand All @@ -209,7 +204,7 @@ func needSystemd(config vc.HypervisorConfig) bool {
// setKernelParams adds the user-specified kernel parameters (from the
// configuration file) to the defaults so that the former take priority.
func setKernelParams(containerID string, runtimeConfig *oci.RuntimeConfig) error {
defaultKernelParams := getKernelParamsFunc(containerID, needSystemd(runtimeConfig.HypervisorConfig))
defaultKernelParams := getKernelParamsFunc(needSystemd(runtimeConfig.HypervisorConfig))

if runtimeConfig.HypervisorConfig.Debug {
strParams := vc.SerializeParams(defaultKernelParams, "=")
Expand Down
6 changes: 4 additions & 2 deletions cli/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func TestCreateInvalidKernelParams(t *testing.T) {
getKernelParamsFunc = savedFunc
}()

getKernelParamsFunc = func(containerID string, needSystemd bool) []vc.Param {
getKernelParamsFunc = func(needSystemd bool) []vc.Param {
return []vc.Param{
{
Key: "",
Expand Down Expand Up @@ -1135,7 +1135,9 @@ func TestSetKernelParams(t *testing.T) {
err := setKernelParams(testContainerID, &config)
assert.NoError(err)

assert.NotEmpty(config.HypervisorConfig.KernelParams)
if needSystemd(config.HypervisorConfig) {
assert.NotEmpty(config.HypervisorConfig.KernelParams)
}
}

func TestSetKernelParamsUserOptionTakesPriority(t *testing.T) {
Expand Down

0 comments on commit 7cdc0fe

Please sign in to comment.