[wip]OTA-1010: pull GetImplicitlyEnabledCapabilities from the cvo repo#1908
[wip]OTA-1010: pull GetImplicitlyEnabledCapabilities from the cvo repo#1908hongkailiu wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
@hongkailiu: This pull request references OTA-1010 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 story to target the "4.19.0" version, but no target version was set. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
f187e0e to
8c7531f
Compare
9cd9e07 to
9cbf3c7
Compare
|
/cc @wking @petr-muller |
petr-muller
left a comment
There was a problem hiding this comment.
Code is just a lift from CVO so maybe that's enough, but it actually looks quite legacy and I would be in favor of some significant refactors if this was new code. And because we're including this in a library, I believe it should meet the bar for new code.
The capabilities are basically treated as sets but we do not use apimachinery Set type and include a lot of code that would not be needed if we used it.
pkg/capability/capability.go
Outdated
| func GetImplicitlyEnabledCapabilities(enabledCapabilities []configv1.ClusterVersionCapability, | ||
| capabilities []configv1.ClusterVersionCapability, | ||
| clusterCapabilities ClusterCapabilities) []configv1.ClusterVersionCapability { |
There was a problem hiding this comment.
TBH the signature and the godoc does not help too much in understanding what is the purpose of the method and what (high-level, semantic) operation ti performs. You give it some capabilities, and it filters some out. It is supposed to return implicitly enabled capabilities, but at the same time, it filters the content of clusterCapabilities.ImplicitlyEnabledCapabilities out? That's confusing. Also, if I am a caller, how is enabledCapabilities different from clusterCapabilities.EnabledCapabilities?
Also, they are all capabilities, so calling the variables as such does not help much. Could we call them enabled and input or something that carries more semantics?
|
Also I think the commit and the PR needs descriptions to explain why the code is pulled from CVO and where do we intend to use it. |
|
I was thinking about "set" too but did not go. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hongkailiu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@hongkailiu: This pull request references OTA-1010 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 story to target the "4.19.0" version, but no target version was set. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@hongkailiu: This pull request references OTA-1010 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 story to target the "4.19.0" version, but no target version was set. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@hongkailiu: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
/remove-lifecycle stale |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
|
/remove-lifecycle rotten |
|
/uncc Cleaning up my dashboards; if I unassign from a PR where my input would still be helpful, feel free to cc/assign me back |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
PR needs rebase. DetailsInstructions 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. |
TODOs