Repository: openshift/assisted-service (language: python)

Issue:
MGMT-19099: Modify default value of MIN_VERSION_FOR_NMSTATE_SERVICE flag to 4.19
Since the current version of nmstate has a bug, it was decided to set the value to 4.19 for now. This means that no one will use the new flow until version 4.19 is released, with the assumption that the bug will be resolved by that time.

<!--
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

You can refer to [Kubernetes community documentation] on writing good commit messages, which provides good tips and ideas.

Some PRs address specific issues. Please, refer to the [CONTRIBUTING] documentation for more
information on how to link a PR to an existing issue.

It's recommended to take a few extra minutes to provide more information about
how this code was tested. Here are some questions that may be worth answering:

- Should this PR be tested by the reviewer?
- Is this PR relying on CI for an e2e test run?
- Should this PR be tested in a specific environment?
- Any logs, screenshots, etc that can help with the review process?

-->

## List all the issues related to this PR

- [ ] New Feature <!-- new functionality -->
- [X] Enhancement <!-- refactor, code changes, improvement, that won't add new features -->
- [ ] Bug fix
- [ ] Tests
- [ ] Documentation
- [ ] CI/CD <!-- Notice that changes for Dockerfiles/Jenkinsfiles aren't tested in CI due to a known bug. -->

## What environments does this code impact?

- [ ] Automation (CI, tools, etc)
- [ ] Cloud
- [ ] Operator Managed Deployments
- [x] None

## How was this code tested?

<!-- Please, select one or more if needed: -->

- [ ] assisted-test-infra environment
- [ ] dev-scripts environment
- [ ] Reviewer's test appreciated
- [ ] Waiting for CI to do a full test run
- [ ] Manual (Elaborate on how it was tested)
- [x] No tests needed

## Checklist

- [ ] Title and description added to both, commit and PR.
- [ ] Relevant issues have been associated (see [CONTRIBUTING] guide)
- [ ] This change does not require a documentation update (docstring, `docs`, README, etc)
- [ ] Does this change include unit-tests (note that code changes require unit-tests)

## Reviewers Checklist

- Are the title and description (in both PR and commit) meaningful and clear?
- Is there a bug required (and linked) for this change?
- Should this PR be backported?

[Kubernetes community documentation]: https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#commit-message-guidelines
[CONTRIBUTING]: https://github.com/openshift/assisted-service/blob/master/CONTRIBUTING.md



Discussion / hints:

Fix patch:
diff --git a/openshift/template.yaml b/openshift/template.yaml
index cf0b0bc83f6..8189aadcea8 100644
--- a/openshift/template.yaml
+++ b/openshift/template.yaml
@@ -3,7 +3,7 @@ parameters:
 - name: ASSISTED_SERVICE_IMAGE
   value: quay.io/app-sre/assisted-service
 - name: MIN_VERSION_FOR_NMSTATE_SERVICE
-  value: '4.18'
+  value: '4.19'
   required: false
 - name: IMAGE_TAG
   value: ''
diff --git a/pkg/staticnetworkconfig/backward_compatibility.go b/pkg/staticnetworkconfig/backward_compatibility.go
index 75e5e8ec45f..7ceb6cdca0f 100644
--- a/pkg/staticnetworkconfig/backward_compatibility.go
+++ b/pkg/staticnetworkconfig/backward_compatibility.go
@@ -7,7 +7,7 @@ import (
 
 type Config struct {
 	// MinVersionForNmstateService is a flag that enables the static networking flow using the nmstate service for specific OCP versions.
-	MinVersionForNmstateService string `envconfig:"MIN_VERSION_FOR_NMSTATE_SERVICE" default:"4.18"`
+	MinVersionForNmstateService string `envconfig:"MIN_VERSION_FOR_NMSTATE_SERVICE" default:"4.19"`
 }
 
 func (s *StaticNetworkConfigGenerator) NMStatectlServiceSupported(version, arch string) (bool, error) {


Test patch:
diff --git a/internal/common/test_configuration.go b/internal/common/test_configuration.go
index 8cfa058cce9..db95cf92bec 100644
--- a/internal/common/test_configuration.go
+++ b/internal/common/test_configuration.go
@@ -49,7 +49,7 @@ type TestConfiguration struct {
 
 const TestDiskId = "/dev/disk/by-id/test-disk-id"
 const TestDiskPath = "/dev/test-disk"
-const MinimalVersionForNmstatectl = "4.18"
+const MinimalVersionForNmstatectl = "4.19"
 
 var (
 	OpenShiftVersion string = "4.6"
diff --git a/internal/ignition/discovery_test.go b/internal/ignition/discovery_test.go
index 2ca800b0ac9..3008d2d99fa 100644
--- a/internal/ignition/discovery_test.go
+++ b/internal/ignition/discovery_test.go
@@ -554,6 +554,7 @@ var _ = Describe("IgnitionBuilder", func() {
 			Expect(count).Should(Equal(3))
 		})
 		It("produces a valid ignition v3.1 spec with static ips paramters - ocp versions greater than/ equal to MinimalVersionForNmstatectl, x86 arch", func() {
+			Skip("skip since no ocp 4.19 yet")
 			mockStaticNetworkConfig.EXPECT().GenerateStaticNetworkConfigDataYAML(formattedInput).Return(staticNetworkConfigNmpolicyOutput, nil).Times(1)
 			infraEnv.StaticNetworkConfig = formattedInput
 			infraEnv.Type = common.ImageTypePtr(models.ImageTypeFullIso)
@@ -576,6 +577,7 @@ var _ = Describe("IgnitionBuilder", func() {
 			Expect(count).Should(Equal(3))
 		})
 		It("produces a valid ignition v3.1 spec with static ips paramters - ocp versions greater than/ equal to MinimalVersionForNmstatectl, arm arch", func() {
+			Skip("skip since no ocp 4.19 yet")
 			mockStaticNetworkConfig.EXPECT().GenerateStaticNetworkConfigData(gomock.Any(), formattedInput).Return(staticNetworkConfigNmpolicyOutput, nil).Times(1)
 			infraEnv.StaticNetworkConfig = formattedInput
 			infraEnv.Type = common.ImageTypePtr(models.ImageTypeFullIso)
@@ -638,6 +640,7 @@ var _ = Describe("IgnitionBuilder", func() {
 			Expect(count).Should(Equal(3))
 		})
 		It("Will include static network config for minimal iso type in infraenv if overridden in call to FormatDiscoveryIgnitionFile - ocp versions greater than/ equal to MinimalVersionForNmstatectl, x86 arch", func() {
+			Skip("skip since no ocp 4.19 yet")
 			mockStaticNetworkConfig.EXPECT().GenerateStaticNetworkConfigDataYAML(formattedInput).Return(staticNetworkConfigNmpolicyOutput, nil).Times(1)
 			mockVersionHandler.EXPECT().GetReleaseImage(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, errors.New("some error")).Times(1)
 			infraEnv.StaticNetworkConfig = formattedInput
@@ -660,6 +663,7 @@ var _ = Describe("IgnitionBuilder", func() {
 			Expect(count).Should(Equal(3))
 		})
 		It("Will include static network config for minimal iso type in infraenv if overridden in call to FormatDiscoveryIgnitionFile - ocp versions greater than/ equal to MinimalVersionForNmstatectl, arm arch", func() {
+			Skip("skip since no ocp 4.19 yet")
 			mockStaticNetworkConfig.EXPECT().GenerateStaticNetworkConfigData(gomock.Any(), formattedInput).Return(staticNetworkConfigNmpolicyOutput, nil).Times(1)
 			mockVersionHandler.EXPECT().GetReleaseImage(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, errors.New("some error")).Times(1)
 			infraEnv.StaticNetworkConfig = formattedInput
diff --git a/pkg/staticnetworkconfig/generator_test.go b/pkg/staticnetworkconfig/generator_test.go
index ee030e908dd..d10e4e5b173 100644
--- a/pkg/staticnetworkconfig/generator_test.go
+++ b/pkg/staticnetworkconfig/generator_test.go
@@ -22,7 +22,7 @@ func TestStaticNetworkConfig(t *testing.T) {
 
 var _ = Describe("StaticNetworkConfig.GenerateStaticNetworkConfigData - generateConfiguration", func() {
 	var (
-		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: "4.18"})
+		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: common.MinimalVersionForNmstatectl})
 	)
 
 	It("Fail with an empty host YAML", func() {
@@ -60,7 +60,7 @@ var _ = Describe("StaticNetworkConfig.GenerateStaticNetworkConfigData - generate
 
 var _ = Describe("validate mac interface mapping", func() {
 	var (
-		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: "4.18"})
+		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: common.MinimalVersionForNmstatectl})
 		singleInterfaceYAML    = `interfaces:
   - name: eth0
     type: ethernet
@@ -354,7 +354,7 @@ var _ = Describe("validate mac interface mapping", func() {
 			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, "4.14", common.X86CPUArchitecture, "agent-installer")
 			Expect(err).ToNot(HaveOccurred())
 		})
-		It("The mac-identifier field is temporarily not supported for flows other than ABI in OCP versions >= 4.18", func() {
+		It("The mac-identifier field is temporarily not supported for flows other than ABI in OCP versions >= MinimalVersionForNmstatectl", func() {
 			staticNetworkConfig := []*models.HostStaticNetworkConfig{
 				{
 					MacInterfaceMap: []*models.MacInterfaceMapItems0{
@@ -366,7 +366,7 @@ var _ = Describe("validate mac interface mapping", func() {
 					NetworkYaml: withMacIdentifier,
 				},
 			}
-			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, "4.18", common.X86CPUArchitecture, "")
+			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, common.MinimalVersionForNmstatectl, common.X86CPUArchitecture, "")
 			Expect(err).To(HaveOccurred())
 		})
 		It("mac-identifier field is supported in ocp-versions < 4.14", func() {
@@ -384,7 +384,7 @@ var _ = Describe("validate mac interface mapping", func() {
 			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, "4.13", common.X86CPUArchitecture, "")
 			Expect(err).ToNot(HaveOccurred())
 		})
-		It("mac-identifier field in the YAML, along with a differing MAC in the mac-map, is temporarily not supported for flows other than ABI in OCP versions >= 4.18", func() {
+		It("mac-identifier field in the YAML, along with a differing MAC in the mac-map, is temporarily not supported for flows other than ABI in OCP versions >= MinimalVersionForNmstatectl", func() {
 			staticNetworkConfig := []*models.HostStaticNetworkConfig{
 				{
 					MacInterfaceMap: []*models.MacInterfaceMapItems0{
@@ -396,7 +396,7 @@ var _ = Describe("validate mac interface mapping", func() {
 					NetworkYaml: withMacIdentifier,
 				},
 			}
-			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, "4.18", common.X86CPUArchitecture, "")
+			err := staticNetworkGenerator.ValidateStaticConfigParamsYAML(staticNetworkConfig, common.MinimalVersionForNmstatectl, common.X86CPUArchitecture, "")
 			Expect(err).To(HaveOccurred())
 		})
 		It("mac-identifier field in the YAML, along with a differing MAC in the mac-map, is allowed for ABI in OCP versions >= 4.14", func() {
@@ -434,7 +434,7 @@ var _ = Describe("validate mac interface mapping", func() {
 
 var _ = Describe("StaticNetworkConfig", func() {
 	var (
-		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: "4.18"})
+		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: common.MinimalVersionForNmstatectl})
 		multipleInterfacesYAML = `interfaces:
   - name: eth0
     type: ethernet
@@ -568,7 +568,7 @@ var _ = Describe("StaticNetworkConfig", func() {
 
 var _ = Describe("StaticNetworkConfig.GenerateStaticNetworkConfigDataYAML - generate nmpolicy", func() {
 	var (
-		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: "4.18"})
+		staticNetworkGenerator = snc.New(logrus.New(), snc.Config{MinVersionForNmstateService: common.MinimalVersionForNmstatectl})
 
 		hostsYAML, hostsYAMLAndIni = `[{ "network_yaml": "%s" }]`, `[{ "network_yaml": "%s", "mac_interface_map": %s }]`
 
diff --git a/subsystem/infra_env_test.go b/subsystem/infra_env_test.go
index 1be223d4b48..19d1af261e4 100644
--- a/subsystem/infra_env_test.go
+++ b/subsystem/infra_env_test.go
@@ -314,8 +314,11 @@ var _ = Describe("Infra_Env", func() {
 		Expect(s.Size()).ShouldNot(Equal(0))
 	})
 
-	DescribeTable("download infra-env files static network config file", func(ocpVersion, arch string) {
+	DescribeTable("download infra-env files static network config file", func(ocpVersion, arch string, skip bool) {
 		By("Patching the infra env with a static network config")
+		if skip {
+			Skip("skip since no ocp 4.19 yet")
+		}
 		netYaml := `interfaces:
 - ipv4:
     address:
@@ -359,10 +362,10 @@ var _ = Describe("Infra_Env", func() {
 		}
 		Expect(contents).To(ContainSubstring("eth0"))
 	},
-		Entry("ocp versions greater than/ equal to MinimalVersionForNmstatectl, x86 arch", common.MinimalVersionForNmstatectl, common.X86CPUArchitecture),
-		Entry("ocp versions greater than/ equal to MinimalVersionForNmstatectl, arm arch", common.MinimalVersionForNmstatectl, common.ARM64CPUArchitecture),
-		Entry("ocp versions less than MinimalVersionForNmstatectl, x86 arch", "4.12", common.X86CPUArchitecture),
-		Entry("ocp versions less than MinimalVersionForNmstatectl, arm arch", "4.12", common.ARM64CPUArchitecture),
+		Entry("ocp versions greater than/ equal to MinimalVersionForNmstatectl, x86 arch", common.MinimalVersionForNmstatectl, common.X86CPUArchitecture, true),
+		Entry("ocp versions greater than/ equal to MinimalVersionForNmstatectl, arm arch", common.MinimalVersionForNmstatectl, common.ARM64CPUArchitecture, true),
+		Entry("ocp versions less than MinimalVersionForNmstatectl, x86 arch", "4.12", common.X86CPUArchitecture, false),
+		Entry("ocp versions less than MinimalVersionForNmstatectl, arm arch", "4.12", common.ARM64CPUArchitecture, false),
 	)
 
 	It("download infra-env files invalid filename option", func() {