-
Notifications
You must be signed in to change notification settings - Fork 78
feat: create new ttr for tiertemplate updates #1102
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
feat: create new ttr for tiertemplate updates #1102
Conversation
|
/retest updated host pr |
MatousJobanek
left a comment
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.
Looks good
| // GreaterOrEqual checks if the number of TTRs is greater or equal than the expected one | ||
| func GreaterOrEqual(count int) TierTemplateRevisionWaitCriterion { | ||
| return TierTemplateRevisionWaitCriterion{ | ||
| Match: func(actual []toolchainv1alpha1.TierTemplateRevision) bool { | ||
| return len(actual) >= count | ||
| }, | ||
| Diff: func(actual []toolchainv1alpha1.TierTemplateRevision) string { | ||
| return fmt.Sprintf("number of ttrs %d is not greater or equal than %d \n", len(actual), count) | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| // LessOrEqual checks if the number of TTRs is less or equal than the expected one | ||
| func LessOrEqual(count int) TierTemplateRevisionWaitCriterion { | ||
| return TierTemplateRevisionWaitCriterion{ | ||
| Match: func(actual []toolchainv1alpha1.TierTemplateRevision) bool { | ||
| return len(actual) <= count | ||
| }, | ||
| Diff: func(actual []toolchainv1alpha1.TierTemplateRevision) string { | ||
| return fmt.Sprintf("number of ttrs %d is not less or equal than %d \n", len(actual), count) | ||
| }, | ||
| } | ||
| } |
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.
btw, these could be generic functions available as part of the new wait.For API
but that's for later, not for this PR 😉
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.
yeah, not huge expert and fan of generic code, but I agree it might make sense.
Actually there's also a lot of margin for improvement in the assertions of the TTRs as well. We can do those later if that makes sense.
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.
As mentioned during the sync call, I found a way we can use the standard assertion functions
#1073 (comment)
Co-authored-by: Matous Jobanek <mjobanek@redhat.com>
|
@MatousJobanek sorry, I've pushed few other fixes after you approved. Could you PTAL at 719c2a1 I've realized later that there were some problems with the test. Sorry for that! |
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MatousJobanek, mfrancisc The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



e2e tests for codeready-toolchain/host-operator#1130
Verifying that once we update the
TierTemplate.Spce.TemplateObjectsfield or theNSTemplateTier.Spec.Parametersa new ttr's are created.Jira: https://issues.redhat.com/browse/KUBESAW-257