Skip to content

Commit

Permalink
compute: Deprecate DockerSELinuxMCSWorkaround
Browse files Browse the repository at this point in the history
Warn that DockerSELinuxMCSWorkaround FG is going to be removed.

Signed-off-by: bmordeha <[email protected]>
  • Loading branch information
Barakmor1 committed Oct 6, 2024
1 parent f7a7c2f commit 9bb85b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/virt-api/webhooks/fuzz/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func fuzzKubeVirtConfig(seed int64) *virtconfig.ClusterConfig {
virtconfig.Root,
virtconfig.ClusterProfiler,
virtconfig.WorkloadEncryptionSEV,
virtconfig.DockerSELinuxMCSWorkaround,
deprecation.DockerSELinuxMCSWorkaround,
deprecation.PSA,
virtconfig.VSOCKGate,
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/virt-config/deprecation/feature-gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const (

PasstGate = "Passt" // Deprecated
MacvtapGate = "Macvtap" // Deprecated
// DockerSELinuxMCSWorkaround sets the SELinux level of all the non-compute virt-launcher containers to "s0".
DockerSELinuxMCSWorkaround = "DockerSELinuxMCSWorkaround" // Deprecated
)

type FeatureGate struct {
Expand All @@ -76,6 +78,7 @@ func init() {

RegisterFeatureGate(FeatureGate{Name: PasstGate, State: Discontinued, Message: PasstDiscontinueMessage, VmiSpecUsed: passtApiUsed})
RegisterFeatureGate(FeatureGate{Name: MacvtapGate, State: Discontinued, Message: MacvtapDiscontinueMessage, VmiSpecUsed: macvtapApiUsed})
RegisterFeatureGate(FeatureGate{Name: DockerSELinuxMCSWorkaround, State: Deprecated, Message: fmt.Sprintf("DockerSELinuxMCSWorkaround has been discontinued since v1.4.")})
}

// RegisterFeatureGate adds a given feature-gate to the FG list
Expand Down
4 changes: 1 addition & 3 deletions pkg/virt-config/feature-gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ const (
Root = "Root"
ClusterProfiler = "ClusterProfiler"
WorkloadEncryptionSEV = "WorkloadEncryptionSEV"
// DockerSELinuxMCSWorkaround sets the SELinux level of all the non-compute virt-launcher containers to "s0".
DockerSELinuxMCSWorkaround = "DockerSELinuxMCSWorkaround"
VSOCKGate = "VSOCK"
// DisableCustomSELinuxPolicy disables the installation of the custom SELinux policy for virt-launcher
DisableCustomSELinuxPolicy = "DisableCustomSELinuxPolicy"
Expand Down Expand Up @@ -191,7 +189,7 @@ func (config *ClusterConfig) WorkloadEncryptionSEVEnabled() bool {
}

func (config *ClusterConfig) DockerSELinuxMCSWorkaroundEnabled() bool {
return config.isFeatureGateEnabled(DockerSELinuxMCSWorkaround)
return config.isFeatureGateEnabled(deprecation.DockerSELinuxMCSWorkaround)
}

func (config *ClusterConfig) VSOCKEnabled() bool {
Expand Down
1 change: 1 addition & 0 deletions pkg/virt-controller/services/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ go_test(
"//pkg/testutils:go_default_library",
"//pkg/util:go_default_library",
"//pkg/virt-config:go_default_library",
"//pkg/virt-config/deprecation:go_default_library",
"//pkg/virt-controller/watch/topology:go_default_library",
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/client-go/api:go_default_library",
Expand Down
3 changes: 2 additions & 1 deletion pkg/virt-controller/services/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
"kubevirt.io/kubevirt/pkg/testutils"
"kubevirt.io/kubevirt/pkg/util"
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
"kubevirt.io/kubevirt/pkg/virt-config/deprecation"
"kubevirt.io/kubevirt/pkg/virt-controller/watch/topology"
"kubevirt.io/kubevirt/tools/vms-generator/utils"
)
Expand Down Expand Up @@ -525,7 +526,7 @@ var _ = Describe("Template", func() {
if enableWorkaround {
kvConfig.Spec.Configuration.DeveloperConfiguration.FeatureGates =
append(kvConfig.Spec.Configuration.DeveloperConfiguration.FeatureGates,
virtconfig.DockerSELinuxMCSWorkaround)
deprecation.DockerSELinuxMCSWorkaround)
}
testutils.UpdateFakeKubeVirtClusterConfig(kvStore, kvConfig)

Expand Down

0 comments on commit 9bb85b5

Please sign in to comment.