New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MGMT-16332: fix issue validating pre-release versions #5837
MGMT-16332: fix issue validating pre-release versions #5837
Conversation
@eifrach: This pull request references MGMT-16332 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.16.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
&common.Cluster{Cluster: models.Cluster{HighAvailabilityMode: &fullHaMode, Hosts: []*models.Host{hostWithSufficientResources, hostWithSufficientResources}, OpenshiftVersion: "4.15.0-rc0"}}, | ||
api.ValidationResult{Status: api.Success, ValidationId: operator.GetHostValidationID()}, | ||
), | ||
table.Entry("High Availability Mode Full with higher than LvmMinMultiNodeSupportVersion", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add SNO with openshift version > LvmMinMultiNodeSupportVersion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already there - the naming is a big confusing
noneHaMode := models.ClusterHighAvailabilityModeNone
assisted-service/internal/operators/lvm/lvm_operator_test.go
Lines 123 to 130 in a209574
table.Entry("High Availability Mode None and Openshift version less than minimal", | |
&common.Cluster{Cluster: models.Cluster{HighAvailabilityMode: &noneHaMode, Hosts: []*models.Host{hostWithSufficientResources}, OpenshiftVersion: "4.10.0"}}, | |
api.ValidationResult{Status: api.Failure, ValidationId: operator.GetHostValidationID(), Reasons: []string{"Logical Volume Manager is only supported for openshift versions 4.11.0 and above"}}, | |
), | |
table.Entry("High Availability Mode None and Openshift version more than minimal", | |
&common.Cluster{Cluster: models.Cluster{HighAvailabilityMode: &noneHaMode, Hosts: []*models.Host{hostWithSufficientResources}, OpenshiftVersion: operator.config.LvmMinOpenshiftVersion}}, | |
api.ValidationResult{Status: api.Success, ValidationId: operator.GetHostValidationID()}, | |
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep sorry I've missed it 😓
@@ -94,7 +94,7 @@ func (o *operator) ValidateCluster(_ context.Context, cluster *common.Cluster) ( | |||
if err != nil { | |||
return api.ValidationResult{Status: api.Failure, ValidationId: o.GetHostValidationID(), Reasons: []string{err.Error()}}, nil | |||
} | |||
if ocpVersion.LessThan(minOpenshiftVersionForMultiNodeSupport) && !common.IsSingleNodeCluster(cluster) { | |||
if ok, _ := common.BaseVersionLessThan(minOpenshiftVersionForMultiNodeSupport.String(), ocpVersion.String()); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check about being SNO disappeared, is that intended?
IIUC in this case SNO with version greater than minimum for multi node would pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need for it - was redandent
there is an if statement before
assisted-service/internal/operators/lvm/lvm_operator.go
Lines 82 to 87 in a209574
if common.IsSingleNodeCluster(cluster) { | |
minOpenshiftVersionForLvm, err := version.NewVersion(o.config.LvmMinOpenshiftVersion) | |
if err != nil { | |
return api.ValidationResult{Status: api.Failure, ValidationId: o.GetHostValidationID(), Reasons: []string{err.Error()}}, nil | |
} | |
if ok, _ := common.BaseVersionLessThan(minOpenshiftVersionForLvm.String(), ocpVersion.String()); ok { |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eifrach, rccrdpccl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5837 +/- ##
==========================================
+ Coverage 67.97% 67.98% +0.01%
==========================================
Files 235 236 +1
Lines 34482 34499 +17
==========================================
+ Hits 23439 23455 +16
- Misses 8977 8979 +2
+ Partials 2066 2065 -1
|
@eifrach: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[ART PR BUILD NOTIFIER] This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202312212208.p0.gb7cd5d1.assembly.stream for distgit ose-agent-installer-api-server. |
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs
, README, etc)Reviewers Checklist