-
Notifications
You must be signed in to change notification settings - Fork 230
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]OTA-1010: pull GetImplicitlyEnabledCapabilities from the cvo repo #1908
base: master
Are you sure you want to change the base?
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. 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 openshift-eng/jira-lifecycle-plugin repository. |
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f187e0e
to
8c7531f
Compare
9cd9e07
to
9cbf3c7
Compare
/cc @wking @petr-muller |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
|
||
// GetImplicitlyEnabledCapabilities returns the capabilities from | ||
// a set of capabilities that are not (even implicitly) enabled in ClusterCapabilities: | ||
func GetImplicitlyEnabledCapabilities( |
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.
This one seems too simple to be exported.
Let me think.
@hongkailiu: 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-sigs/prow repository. I understand the commands that are listed here. |
No description provided.