Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions pkg/asset/machines/machineconfig/hyperthreading.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ package machineconfig
import (
"fmt"

igntypes "github.com/coreos/ignition/config/v2_2/types"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/openshift/installer/pkg/asset/ignition"
)

// 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.
func ForHyperthreadingDisabled(role string) *mcfgv1.MachineConfig {
return &mcfgv1.MachineConfig{
TypeMeta: metav1.TypeMeta{
Expand All @@ -25,15 +21,8 @@ func ForHyperthreadingDisabled(role string) *mcfgv1.MachineConfig {
},
},
Spec: mcfgv1.MachineConfigSpec{
Config: 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"),
},
},
KernelArguments: []string{
"nosmt",
},
},
}
Expand Down
30 changes: 6 additions & 24 deletions pkg/asset/machines/master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,13 @@ spec:
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
verification: {}
filesystem: root
mode: 384
path: /etc/pivot/kernel-args
user:
name: root
storage: {}
systemd: {}
fips: false
kernelArguments: null
kernelArguments:
- nosmt
osImageURL: ""
`},
},
Expand All @@ -112,22 +103,13 @@ spec:
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
verification: {}
filesystem: root
mode: 384
path: /etc/pivot/kernel-args
user:
name: root
storage: {}
systemd: {}
fips: false
kernelArguments: null
kernelArguments:
- nosmt
osImageURL: ""
`, `apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
Expand Down
30 changes: 6 additions & 24 deletions pkg/asset/machines/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,13 @@ spec:
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
verification: {}
filesystem: root
mode: 384
path: /etc/pivot/kernel-args
user:
name: root
storage: {}
systemd: {}
fips: false
kernelArguments: null
kernelArguments:
- nosmt
osImageURL: ""
`},
},
Expand All @@ -112,22 +103,13 @@ spec:
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,QUREIG5vc210
verification: {}
filesystem: root
mode: 384
path: /etc/pivot/kernel-args
user:
name: root
storage: {}
systemd: {}
fips: false
kernelArguments: null
kernelArguments:
- nosmt
osImageURL: ""
`, `apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
Expand Down