declare live migration feature gate as deprecated
1. Create function to identify deprecated functions
2. List of deprecated feature gates
3. Every deprecated feature gate is considered enabled
@@ -49,7 +49,17 @@ const (
WorkloadEncryptionSEV = "WorkloadEncryptionSEV"
)
+var deprecatedFeatureGates = [...]string{
+ LiveMigrationGate,
+}
+
func (c *ClusterConfig) isFeatureGateEnabled(featureGate string) bool {
+ if c.IsFeatureGateDeprecated(featureGate) {
+ // Deprecated feature gates are considered enabled and no-op.
+ // For more info about deprecation policy: https://github.com/kubevirt/kubevirt/blob/main/docs/deprecation.md
+ return true
+ }
+
for _, fg := range c.GetConfig().DeveloperConfiguration.FeatureGates {
if fg == featureGate {
return true
@@ -58,6 +68,16 @@ func (c *ClusterConfig) isFeatureGateEnabled(featureGate string) bool {
return false
}
+func (c *ClusterConfig) IsFeatureGateDeprecated(featureGate string) bool {
+ for _, deprecatedFeatureGate := range deprecatedFeatureGates {
+ if featureGate == deprecatedFeatureGate {
+ return true
+ }
+ }
+
+ return false
+}
+
func (config *ClusterConfig) ExpandDisksEnabled() bool {
return config.isFeatureGateEnabled(ExpandDisksGate)
}
@@ -79,8 +99,7 @@ func (config *ClusterConfig) IgnitionEnabled() bool {
}
func (config *ClusterConfig) LiveMigrationEnabled() bool {
- return config.isFeatureGateEnabled(LiveMigrationGate) ||
- config.isFeatureGateEnabled(SRIOVLiveMigrationGate)
+ return config.isFeatureGateEnabled(LiveMigrationGate)
}
func (config *ClusterConfig) SRIOVLiveMigrationEnabled() bool {
