Skip to content

Commit

Permalink
Merge pull request openshift#5439 from LorbusChris/mc-kargs
Browse files Browse the repository at this point in the history
[MCO-8] machineconfig: Use KernelArguments field instead of kernel-args file
  • Loading branch information
openshift-merge-robot authored Dec 16, 2021
2 parents 42a56b7 + 26868a7 commit 2d4c504
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 47 deletions.
10 changes: 3 additions & 7 deletions pkg/asset/machines/machineconfig/hyperthreading.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ import (
)

// ForHyperthreadingDisabled creates the MachineConfig to disable hyperthreading.
// RHCOS ships with pivot.service that uses the `/etc/pivot/kernel-args` to override the kernel arguments for hosts.
// RHCOS ships with pivot.service to override the kernel arguments for hosts.
func ForHyperthreadingDisabled(role string) (*mcfgv1.MachineConfig, error) {
ignConfig := igntypes.Config{
Ignition: igntypes.Ignition{
Version: igntypes.MaxVersion.String(),
},
Storage: igntypes.Storage{
Files: []igntypes.File{
ignition.FileFromString("/etc/pivot/kernel-args", "root", 0600, "ADD nosmt"),
},
},
}

rawExt, err := ignition.ConvertToRawExtension(ignConfig)
Expand All @@ -41,7 +36,8 @@ func ForHyperthreadingDisabled(role string) (*mcfgv1.MachineConfig, error) {
},
},
Spec: mcfgv1.MachineConfigSpec{
Config: rawExt,
Config: rawExt,
KernelArguments: []string{"nosmt"},
},
}, nil
}
24 changes: 4 additions & 20 deletions pkg/asset/machines/master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,10 @@ spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
mode: 384
overwrite: true
path: /etc/pivot/kernel-args
user:
name: root
extensions: null
fips: false
kernelArguments: null
kernelArguments:
- nosmt
kernelType: ""
osImageURL: ""
`},
Expand All @@ -103,18 +95,10 @@ spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
mode: 384
overwrite: true
path: /etc/pivot/kernel-args
user:
name: root
extensions: null
fips: false
kernelArguments: null
kernelArguments:
- nosmt
kernelType: ""
osImageURL: ""
`, `apiVersion: machineconfiguration.openshift.io/v1
Expand Down
24 changes: 4 additions & 20 deletions pkg/asset/machines/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,10 @@ spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
mode: 384
overwrite: true
path: /etc/pivot/kernel-args
user:
name: root
extensions: null
fips: false
kernelArguments: null
kernelArguments:
- nosmt
kernelType: ""
osImageURL: ""
`},
Expand All @@ -98,18 +90,10 @@ spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
mode: 384
overwrite: true
path: /etc/pivot/kernel-args
user:
name: root
extensions: null
fips: false
kernelArguments: null
kernelArguments:
- nosmt
kernelType: ""
osImageURL: ""
`, `apiVersion: machineconfiguration.openshift.io/v1
Expand Down

0 comments on commit 2d4c504

Please sign in to comment.