diff --git a/internal/bminventory/inventory.go b/internal/bminventory/inventory.go index 709814c12e1..7f2cb94aa72 100644 --- a/internal/bminventory/inventory.go +++ b/internal/bminventory/inventory.go @@ -98,7 +98,7 @@ type Config struct { IPv6Support bool `envconfig:"IPV6_SUPPORT" default:"true"` } -const minimalOpenShiftVersionForSingleNode = "4.8.0-fc.0" +const minimalOpenShiftVersionForSingleNode = "4.8.0-0.0" type OCPClusterAPI interface { RegisterOCPCluster(ctx context.Context) error diff --git a/internal/bminventory/inventory_test.go b/internal/bminventory/inventory_test.go index f79974c8d53..f3e2b778ec3 100644 --- a/internal/bminventory/inventory_test.go +++ b/internal/bminventory/inventory_test.go @@ -2174,6 +2174,30 @@ var _ = Describe("cluster", func() { Expect(actual.Payload.VipDhcpAllocation).To(Equal(swag.Bool(false))) }) }) + It("create non ha cluster success, release version is ci-release and greater than minimal", func() { + bm.clusterApi = cluster.NewManager(cluster.Config{}, common.GetTestLog().WithField("pkg", "cluster-monitor"), + db, mockEvents, nil, nil, nil, nil, nil, nil, nil, nil) + + mockClusterRegisterSuccess(bm, true) + noneHaMode := models.ClusterHighAvailabilityModeNone + openShiftVersionForNoneHA := "4.8.0-0.ci.test-2021-05-20-000749-ci-op-7xrzwgwy-latest" + reply := bm.RegisterCluster(ctx, installer.RegisterClusterParams{ + NewClusterParams: &models.ClusterCreateParams{ + Name: swag.String("some-cluster-name"), + OpenshiftVersion: swag.String(openShiftVersionForNoneHA), + PullSecret: swag.String("{\"auths\":{\"cloud.openshift.com\":{\"auth\":\"dG9rZW46dGVzdAo=\",\"email\":\"coyote@acme.com\"}}}"), + HighAvailabilityMode: &noneHaMode, + VipDhcpAllocation: swag.Bool(true), + }, + }) + Expect(reflect.TypeOf(reply)).Should(Equal(reflect.TypeOf(installer.NewRegisterClusterCreated()))) + actual := reply.(*installer.RegisterClusterCreated) + Expect(actual.Payload.HighAvailabilityMode).To(Equal(swag.String(noneHaMode))) + Expect(actual.Payload.UserManagedNetworking).To(Equal(swag.Bool(true))) + // verify VipDhcpAllocation was set to false even though it was sent as true + Expect(actual.Payload.VipDhcpAllocation).To(Equal(swag.Bool(false))) + }) + Context("Update", func() { BeforeEach(func() { mockDurationsSuccess()