Skip to content

Commit

Permalink
OCPBUGSM-29306 Allow creating SNO cluster with any 4.8.0-x version
Browse files Browse the repository at this point in the history
  • Loading branch information
eranco74 authored and YuviGold committed May 20, 2021
1 parent aa245bf commit ac871fd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/bminventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions internal/bminventory/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\":\"[email protected]\"}}}"),
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()
Expand Down

0 comments on commit ac871fd

Please sign in to comment.