Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Snapshot feature gate on the Kubevirt ConfigMap #805

Merged
merged 1 commit into from
Sep 17, 2020
Merged
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
Enable Snapshot feature gate on the Kubevirt ConfigMap
Start reconciling also virtconfig.FeatureGatesKey
(currently only on HCO upgrade) to set the new
value also on deployment started in the past.
In the next version we are going to continuously
reconciling the whole ConfigMap.

Fixes: Bug-Url: https://bugzilla.redhat.com/1878060

Signed-off-by: Simone Tiraboschi <[email protected]>
tiraboschi committed Sep 16, 2020
commit fb3789f5f36fab240930b063c0b3ad8b6b94fa2e
17 changes: 12 additions & 5 deletions pkg/controller/hyperconverged/hyperconverged_controller.go
Original file line number Diff line number Diff line change
@@ -790,10 +790,13 @@ func newKubeVirtConfigForCR(cr *hcov1beta1.HyperConverged, namespace string) *co
Labels: labels,
Namespace: namespace,
},
// only virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey and
// virtconfig.UseEmulationKey are going to be manipulated and only on HCO upgrades
// only virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey,
// virtconfig.FeatureGatesKey and virtconfig.UseEmulationKey are going to be manipulated
// and only on HCO upgrades.
// TODO: This is going to change in the next HCO release where the whole configMap is going
// to be continuously reconciled
Data: map[string]string{
virtconfig.FeatureGatesKey: "DataVolumes,SRIOV,LiveMigration,CPUManager,CPUNodeDiscovery,Sidecar",
virtconfig.FeatureGatesKey: "DataVolumes,SRIOV,LiveMigration,CPUManager,CPUNodeDiscovery,Sidecar,Snapshot",
virtconfig.MigrationsConfigKey: `{"nodeDrainTaintKey" : "node.kubernetes.io/unschedulable"}`,
virtconfig.SELinuxLauncherTypeKey: "virt_launcher.process",
virtconfig.NetworkInterfaceKey: kubevirtDefaultNetworkInterfaceValue,
@@ -850,9 +853,13 @@ func (r *ReconcileHyperConverged) ensureKubeVirtConfig(req *hcoRequest) *EnsureR
objectreferencesv1.SetObjectReference(&req.instance.Status.RelatedObjects, *objectRef)

if r.upgradeMode {
// only virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey and
// virtconfig.UseEmulationKey are going to be manipulated and only on HCO upgrades
// only virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey,
// virtconfig.FeatureGatesKey and virtconfig.UseEmulationKey are going to be manipulated
// and only on HCO upgrades.
// TODO: This is going to change in the next HCO release where the whole configMap is going
// to be continuously reconciled
for _, k := range []string{
virtconfig.FeatureGatesKey,
virtconfig.SmbiosConfigKey,
virtconfig.MachineTypeKey,
virtconfig.SELinuxLauncherTypeKey,
Original file line number Diff line number Diff line change
@@ -126,8 +126,8 @@ var _ = Describe("HyperConverged Components", func() {
var hco *hcov1beta1.HyperConverged
var req *hcoRequest

updatableKeys := [...]string{virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey}
unupdatableKeys := [...]string{virtconfig.FeatureGatesKey, virtconfig.MigrationsConfigKey, virtconfig.NetworkInterfaceKey}
updatableKeys := [...]string{virtconfig.SmbiosConfigKey, virtconfig.MachineTypeKey, virtconfig.SELinuxLauncherTypeKey, virtconfig.FeatureGatesKey}
unupdatableKeys := [...]string{virtconfig.MigrationsConfigKey, virtconfig.NetworkInterfaceKey}

BeforeEach(func() {
hco = newHco()
@@ -182,8 +182,8 @@ var _ = Describe("HyperConverged Components", func() {
outdatedResource.Data[virtconfig.SmbiosConfigKey] = "old-smbios-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.MachineTypeKey] = "old-machinetype-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.SELinuxLauncherTypeKey] = "old-selinuxlauncher-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.FeatureGatesKey] = "old-featuregates-value-that-we-have-to-update"
// values we should preserve
outdatedResource.Data[virtconfig.FeatureGatesKey] = "old-featuregates-value-that-we-should-preserve"
outdatedResource.Data[virtconfig.MigrationsConfigKey] = "old-migrationsconfig-value-that-we-should-preserve"
outdatedResource.Data[virtconfig.NetworkInterfaceKey] = "old-defaultnetworkinterface-value-that-we-should-preserve"

@@ -222,8 +222,8 @@ var _ = Describe("HyperConverged Components", func() {
outdatedResource.Data[virtconfig.SmbiosConfigKey] = "old-smbios-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.MachineTypeKey] = "old-machinetype-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.SELinuxLauncherTypeKey] = "old-selinuxlauncher-value-that-we-have-to-update"
outdatedResource.Data[virtconfig.FeatureGatesKey] = "old-featuregates-value-that-we-have-to-update"
// values we should preserve
outdatedResource.Data[virtconfig.FeatureGatesKey] = "old-featuregates-value-that-we-should-preserve"
outdatedResource.Data[virtconfig.MigrationsConfigKey] = "old-migrationsconfig-value-that-we-should-preserve"
outdatedResource.Data[virtconfig.DefaultNetworkInterface] = "old-defaultnetworkinterface-value-that-we-should-preserve"