-
Notifications
You must be signed in to change notification settings - Fork 21
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
managedcluster-controller tests #830
base: main
Are you sure you want to change the base?
managedcluster-controller tests #830
Conversation
20e9cdb
to
8010dd2
Compare
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.
minor comments, please consider to address
getter := NewMemoryRESTClientGetter(a.Config, a.RESTMapper) | ||
actionConfig := new(action.Configuration) | ||
err := actionConfig.Init(getter, clusterDeployment.Namespace, "secret", log) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return actionConfig, nil |
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.
getter := NewMemoryRESTClientGetter(a.Config, a.RESTMapper) | |
actionConfig := new(action.Configuration) | |
err := actionConfig.Init(getter, clusterDeployment.Namespace, "secret", log) | |
if err != nil { | |
return nil, err | |
} | |
return actionConfig, nil | |
actionConfig := new(action.Configuration) | |
return actionConfig, actionConfig.Init(NewMemoryRESTClientGetter(a.Config, a.RESTMapper), clusterDeployment.Namespace, "secret", log) |
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.
@zerospiel is it ok for our code-style, that the function returning pointer and error, will return pointer to type's zero value along with an error? Isn't it more correct to return nil, err
in case of error and value, nil
in case no error occurred?
Besides that, is it really worth packing all calls into a single-line return if it doesn't affect anything other than readability (which is very subjective measurement)?
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.
just nitting, it was a suggestion obviously to my own style/preferences , up to the developer though
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
fe7bc24
to
58f8620
Compare
Fixes: #822