Skip to content

Commit

Permalink
MGMT-19080: Change the cluster validations to enable installation of …
Browse files Browse the repository at this point in the history
…3-5 control plane clusters in day1
  • Loading branch information
danmanor committed Oct 15, 2024
1 parent 3b752de commit 2a91b66
Show file tree
Hide file tree
Showing 21 changed files with 296 additions and 202 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/bminventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ func (b *bareMetalInventory) InstallClusterInternal(ctx context.Context, params
//usage for auto role selection is measured only for day1 clusters with more than
//3 hosts (which would automatically be assigned as masters if the hw is sufficient)
if usages, u_err := usage.Unmarshal(cluster.Cluster.FeatureUsage); u_err == nil {
report := cluster.Cluster.TotalHostCount > common.MinMasterHostsNeededForInstallation && autoAssigned
report := cluster.Cluster.TotalHostCount > common.MinMasterHostsNeededForInstallationInHaMode && autoAssigned
if hasIgnoredValidations {
b.setUsage(true, usage.ValidationsIgnored, nil, usages)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3542,7 +3542,7 @@ var _ = Describe("Validation metrics and events", func() {
validationRes := ValidationsStatus{
"hw": {
{
ID: SufficientMastersCount,
ID: SufficientMastersAndWorkersCount,
Status: status,
},
},
Expand Down Expand Up @@ -3591,7 +3591,7 @@ var _ = Describe("Validation metrics and events", func() {

It("Test DeregisterCluster", func() {
mockHost.EXPECT().ReportValidationFailedMetrics(ctx, gomock.Any(), openshiftVersion, emailDomain)
mockMetric.EXPECT().ClusterValidationFailed(models.ClusterValidationIDSufficientMastersCount)
mockMetric.EXPECT().ClusterValidationFailed(models.ClusterValidationIDSufficientMastersAndWorkersCount)
mockEvents.EXPECT().SendClusterEvent(ctx, eventstest.NewEventMatcher(
eventstest.WithNameMatcher(eventgen.ClusterDeregisteredEventName),
eventstest.WithClusterIdMatcher(c.ID.String())))
Expand Down Expand Up @@ -3622,7 +3622,7 @@ var _ = Describe("Validation metrics and events", func() {
Expect(err).ToNot(HaveOccurred())
m.reportValidationStatusChanged(ctx, c, newValidationRes, currentValidationRes)

mockMetric.EXPECT().ClusterValidationChanged(models.ClusterValidationIDSufficientMastersCount)
mockMetric.EXPECT().ClusterValidationChanged(models.ClusterValidationIDSufficientMastersAndWorkersCount)
mockEvents.EXPECT().SendClusterEvent(ctx, eventstest.NewEventMatcher(
eventstest.WithClusterIdMatcher(c.ID.String())))

Expand Down
4 changes: 2 additions & 2 deletions internal/cluster/refresh_status_preprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ func newValidations(v *clusterValidator) []validation {
condition: v.allHostsAreReadyToInstall,
},
{
id: SufficientMastersCount,
condition: v.sufficientMastersCount,
id: SufficientMastersAndWorkersCount,
condition: v.sufficientMastersAndWorkersCount,
},
{
id: IsDNSDomainDefined,
Expand Down
2 changes: 1 addition & 1 deletion internal/cluster/statemachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func NewClusterStateMachine(th TransitionHandler) stateswitch.StateMachine {
If(AreApiVipsValid),
If(AreIngressVipsValid),
If(AllHostsAreReadyToInstall),
If(SufficientMastersCount),
If(SufficientMastersAndWorkersCount),
If(networkPrefixValid),
If(noCidrOverlapping),
If(IsNtpServerConfigured),
Expand Down
Loading

0 comments on commit 2a91b66

Please sign in to comment.