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

WIP: pkg/cvo/availableupdates: Add recommend/... conditions for each matching or eval-failed risk #1132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wking
Copy link
Member

@wking wking commented Jan 7, 2025

To make it easier for clients to explain individual risks, instead of only having access to a generic MultipleReasons reason and a long message covering all the risks.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 7, 2025
Copy link
Contributor

openshift-ci bot commented Jan 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wking

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2025
@wking wking force-pushed the condition-for-each-matching-conditional-update-risk branch 10 times, most recently from 7588be6 to a0a3b54 Compare January 7, 2025 06:19
@petr-muller
Copy link
Member

/cc

@openshift-ci openshift-ci bot requested a review from petr-muller January 7, 2025 12:26
msg := unknownExposureMessage(risk, err)
errorMessages = append(errorMessages, msg)
conditions = append(conditions, metav1.Condition{
Type: fmt.Sprintf("%s:%s:%s", ConditionalUpdateConditionTypeRecommended, recommendedReasonEvaluationFailed, cleanName),
Copy link
Member

Choose a reason for hiding this comment

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

What is the reason for including the recommendedReasonEvaluationFailed in the type of the condition when we fail to evaluate it? To me a Recommended:RiskName condition with Status=Unknown and Reason=Something sounds like it does the job...

Also, it seems that : is not a valid character for condition type:

	// The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`
	// +kubebuilder:validation:MaxLength=316

But (dns1123SubdomainFmt/)?(qualifiedNameFmt) sounds like we can invent something like recommended.openshift.io/RiskName with sounds good to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks; I've pivoted to recommended/... with a0a3b54 -> c5053ba. I'm a week minus on .openshift.io there; seems unlikely that other folks besides us would be injecting their own conditions, and we don't do that kind of DNS scoping for our core conditions like Failing and otherwise 🤷 But I don't mind adding the scoping if folks think it's worthwhile.

Copy link
Member

Choose a reason for hiding this comment

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

yeah recommended/risk sounds good to me 👍

@wking wking force-pushed the condition-for-each-matching-conditional-update-risk branch from a0a3b54 to aad6ef7 Compare January 13, 2025 17:28
…ching or eval-failed risk

To make it easier for clients to explain individual risks, instead of
only having access to a generic MultipleReasons 'reason' and a long
'message' covering all the risks.

The "recommended/" prefix conforms to [1]:

  +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`

[1]: https://github.com/kubernetes/apimachinery/blob/3e8e52d6a1259ada73f63c1c7d1fad39d4ba9fb4/pkg/apis/meta/v1/types.go#L1609-L1613
@wking wking force-pushed the condition-for-each-matching-conditional-update-risk branch from aad6ef7 to c5053ba Compare January 13, 2025 17:32
@wking wking changed the title WIP: pkg/cvo/availableupdates: Add Recommend:... conditions for each matching or eval-failed risk WIP: pkg/cvo/availableupdates: Add recommend/... conditions for each matching or eval-failed risk Jan 13, 2025
Copy link
Contributor

openshift-ci bot commented Jan 13, 2025

@wking: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agnostic-ovn-upgrade-out-of-change c5053ba link true /test e2e-agnostic-ovn-upgrade-out-of-change
ci/prow/e2e-agnostic-ovn-upgrade-into-change c5053ba link true /test e2e-agnostic-ovn-upgrade-into-change
ci/prow/e2e-agnostic-ovn c5053ba link true /test e2e-agnostic-ovn
ci/prow/e2e-agnostic-operator c5053ba link true /test e2e-agnostic-operator
ci/prow/e2e-aws-ovn-techpreview c5053ba link true /test e2e-aws-ovn-techpreview
ci/prow/e2e-hypershift c5053ba link true /test e2e-hypershift
ci/prow/e2e-hypershift-conformance c5053ba link true /test e2e-hypershift-conformance

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-sigs/prow repository. I understand the commands that are listed here.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants