Skip to content
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

clarify maxOpenShiftVersion upgrade error message #2326

Conversation

ankitathomas
Copy link
Contributor

Signed-off-by: Ankita Thomas [email protected]

@openshift-ci openshift-ci bot requested review from exdx and joelanford August 12, 2021 15:54
Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together!

I was expecting CI to fail without test changes though -- could we add a test to verify the message content?

@@ -110,7 +110,7 @@ func (s skew) String() string {
return fmt.Sprintf("%s/%s has invalid %s properties: %s", s.namespace, s.name, MaxOpenShiftVersionProperty, s.err)
}

return fmt.Sprintf("%s/%s is incompatible with OpenShift versions greater than %s", s.namespace, s.name, s.maxOpenShiftVersion)
return fmt.Sprintf("%s/%s is incompatible with OpenShift minor versions greater than %s", s.namespace, s.name, s.maxOpenShiftVersion)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe skew.maxOpenShiftVersion is the result of directly stringifying the value of the property, which can specify patch versions. I would take care to format the message so that only major.minor is displayed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the test include a maxOpenShift version that includes a patch and could we ensure that the patch version is omitted from the message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we just throw a validation error on a patch version? It doesn't seem to me to make a lot of sense to allow users to even set it like that if we can't actually block those upgrades anyway.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about requiring the operators to declare maxOpenShiftVersion: 4.8.9999 if they support all future 4.8.* versions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just think it's confusing and erroneous to do that. OLM functionally can't do anything special with the patch version here, so we should limit it to the minor version with validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified it to drop the build version and complain on a non-zero patch/pre-release version. I've added a warning on the api validation operator-framework/api#146

@awgreene
Copy link
Member

@ankitathomas thanks for the quick turnaround on this, one suggestion on the test, looks good otherwise.

@ankitathomas ankitathomas force-pushed the maxopenshiftversion-errormsg-fix branch 2 times, most recently from 35f113f to 51493ee Compare August 17, 2021 15:57
@ankitathomas ankitathomas requested a review from njhale August 17, 2021 15:57
@ankitathomas ankitathomas force-pushed the maxopenshiftversion-errormsg-fix branch from 51493ee to fc58b6a Compare August 17, 2021 16:22
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2021
@ankitathomas ankitathomas force-pushed the maxopenshiftversion-errormsg-fix branch from fc58b6a to 9fdf0df Compare August 17, 2021 16:33
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 2021
@ankitathomas ankitathomas force-pushed the maxopenshiftversion-errormsg-fix branch from 9fdf0df to 3467201 Compare August 17, 2021 16:41
Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@@ -2,7 +2,6 @@ package openshift

import (
"fmt"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this newline should exist to delineate standard library imports.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2021
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 17, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ankitathomas, dinhxuanvu, njhale

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit 7c2f004 into operator-framework:master Aug 17, 2021
@sdodson
Copy link

sdodson commented Aug 17, 2021

/retitle Bug 1992677: clarify maxOpenShiftVersion upgrade error message

@openshift-ci openshift-ci bot changed the title clarify maxOpenShiftVersion upgrade error message Bug 1992677: clarify maxOpenShiftVersion upgrade error message Aug 17, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 17, 2021

@ankitathomas: All pull requests linked via external trackers have merged:

Bugzilla bug 1992677 has been moved to the MODIFIED state.

In response to this:

Bug 1992677: clarify maxOpenShiftVersion upgrade error message

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.

@sdodson
Copy link

sdodson commented Aug 17, 2021

/retitle clarify maxOpenShiftVersion upgrade error message

@openshift-ci openshift-ci bot changed the title Bug 1992677: clarify maxOpenShiftVersion upgrade error message clarify maxOpenShiftVersion upgrade error message Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants