-
Notifications
You must be signed in to change notification settings - Fork 4
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
refine names and errors #25
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k 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 |
@deads2k: 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. |
@@ -37,11 +37,11 @@ var ( | |||
_ AllDesiredMutationsGetter = &applyConfiguration{} | |||
) | |||
|
|||
func ValidateAllDesiredMutationsGetter(allDesiredMutationsGetter AllDesiredMutationsGetter, allAllowedOutputResources *libraryoutputresources.OutputResources) error { | |||
func ValidateUnfilteredMutations(allDesiredMutationsGetter AllDesiredMutationsGetter, allAllowedOutputResources *libraryoutputresources.OutputResources) []error { | |||
errs := []error{} |
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.
nit: move closer to where it is used.
return errs | ||
} | ||
|
||
func ValidateAllDesiredMutationsGetter(allDesiredMutationsGetter AllDesiredMutationsGetter, allAllowedOutputResources *libraryoutputresources.OutputResources) []error { |
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.
The previous function (ValidateUnfilteredMutations
) checks if a request is on the allowed list for all resources.
Shouldn't this function instead check if mutations for the given cluster type are on the allowed list specifically for that cluster type?
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.
ok, nvm, pruning/filtering is done at
multi-operator-manager/pkg/library/libraryapplyconfiguration/client_mutations.go
Line 114 in 28a3855
filteredRequests := []manifestclient.SerializedRequestish{} |
errs := []error{} | ||
|
||
if allDesiredMutationsGetter == nil { | ||
return fmt.Errorf("applyConfiguration is required") | ||
return []error{fmt.Errorf("applyConfiguration is required")} | ||
} | ||
|
||
allMutationRequests := []manifestclient.SerializedRequestish{} |
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.
I think that allMutationRequests
contains duplicate entries based on the code at
func NewApplyConfigurationFromClient( |
errs = append(errs, fmt.Errorf("mutations for %q reported type=%q", clusterType, desiredMutationsGetter.GetClusterType())) | ||
} | ||
|
||
allMutationRequests = append(allMutationRequests, desiredMutationsGetter.Requests().AllRequests()...) |
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.
It looks like we're just appending to this slice, but not using it for anything else. Can it be dropped?
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 function duplicates logic from ValidateUnfilteredMutations
, right? We could extract the shared code into a helper and use it in both places.
PR needs rebase. 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. |
No description provided.