Skip to content

Commit

Permalink
KubeVirt: always set the feature gate that disables the custom SELinu…
Browse files Browse the repository at this point in the history
…x policy (#2211)

Signed-off-by: Jed Lejosne <jed@redhat.com>

Signed-off-by: Jed Lejosne <jed@redhat.com>
  • Loading branch information
jean-edouard authored Jan 27, 2023
1 parent 9edac5a commit 8596bc0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ var _ = Describe("HyperconvergedController", func() {
"NUMA",
"WithHostPassthroughCPU",
"VMExport",
"DisableCustomSELinuxPolicy",
}
// Get the KV
kvList := &kubevirtcorev1.KubeVirtList{}
Expand Down
9 changes: 4 additions & 5 deletions controllers/operands/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import (
hcoutil "github.com/kubevirt/hyperconverged-cluster-operator/pkg/util"
)

const (
SELinuxLauncherType = "virt_launcher.process"
)

// env vars
const (
kvmEmulationEnvName = "KVM_EMULATION"
Expand Down Expand Up @@ -96,6 +92,9 @@ const (

// Export VMs to outside of the cluster
kvVMExportGate = "VMExport"

// Disable the installation and usage of the custom SELinux policy
kvDisableCustomSELinuxPolicyGate = "DisableCustomSELinuxPolicy"
)

var (
Expand All @@ -112,6 +111,7 @@ var (
kvDownwardMetricsGate,
kvNUMA,
kvVMExportGate,
kvDisableCustomSELinuxPolicyGate,
}

// holds a list of mandatory KubeVirt feature gates. Some of them are the hard coded feature gates and some of
Expand Down Expand Up @@ -355,7 +355,6 @@ func getKVConfig(hc *hcov1beta1.HyperConverged) (*kubevirtcorev1.KubeVirtConfigu

config := &kubevirtcorev1.KubeVirtConfiguration{
DeveloperConfiguration: devConfig,
SELinuxLauncherType: SELinuxLauncherType,
NetworkConfiguration: &kubevirtcorev1.NetworkConfiguration{
NetworkInterface: string(kubevirtcorev1.MasqueradeInterface),
},
Expand Down
4 changes: 0 additions & 4 deletions controllers/operands/kubevirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ Version: 1.2.3`)
Expect(foundResource.Spec.Configuration.SMBIOSConfig.Sku).Should(Equal("1.2.3"))
Expect(foundResource.Spec.Configuration.SMBIOSConfig.Version).Should(Equal("1.2.3"))

Expect(foundResource.Spec.Configuration.SELinuxLauncherType).Should(Equal(SELinuxLauncherType))

Expect(foundResource.Spec.Configuration.NetworkConfiguration).ToNot(BeNil())
Expect(foundResource.Spec.Configuration.NetworkConfiguration.NetworkInterface).Should(Equal(string(kubevirtcorev1.MasqueradeInterface)))

Expand Down Expand Up @@ -376,8 +374,6 @@ Version: 1.2.3`)
Expect(foundResource.Spec.Configuration.SMBIOSConfig.Sku).Should(Equal("1.2.3"))
Expect(foundResource.Spec.Configuration.SMBIOSConfig.Version).Should(Equal("1.2.3"))

Expect(foundResource.Spec.Configuration.SELinuxLauncherType).Should(Equal(SELinuxLauncherType))

Expect(foundResource.Spec.Configuration.NetworkConfiguration).ToNot(BeNil())
Expect(foundResource.Spec.Configuration.NetworkConfiguration.NetworkInterface).Should(Equal(string(kubevirtcorev1.MasqueradeInterface)))

Expand Down

0 comments on commit 8596bc0

Please sign in to comment.