-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
🐛 (API - External Plugins): Fix external plugin discovery on Linux #3247
🐛 (API - External Plugins): Fix external plugin discovery on Linux #3247
Conversation
Hi @em-r. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/cc @camilamacedo86 |
if err != nil { | ||
return "", fmt.Errorf("error retrieving home dir: %v", err) | ||
} | ||
pluginsRoot = filepath.Join(userHomeDir, pluginsRoot) | ||
|
||
return pluginsRoot, 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.
This method expects a return (pluginsRoot string, err error)
I think it is missing return it
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 reason I have replaced return pluginsRoot, nil
with just return
is because the function uses named returns so I think specifying the variables in the return is redundant, but I can add it back (maybe because of a style convention?) just let me know.
thank you!
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.
If we do not return this values then we should remove them from the signature.
Could you please change that?
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-to-test
@@ -171,26 +171,44 @@ func parseExternalPluginArgs() (args []string) { | |||
return args |
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.
@evansheng @rashmigottipati could you please give a hand to review this one?
I can see the coverage check failed, I'll add more tests to fix this as well. |
f883680
to
6ccbc0f
Compare
coverage drop has been fixed. I'm seeing a failure in k8s-1-24-7 build, however, based on its logs I don't think it's related to the changes in this PR, it seems like some sort of missing file issue in the machine where the build ran. will keep looking into it. |
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.
Thanks for this contribution @em-r , these changes look great!
/lgtm
/retest |
The test failure seems like some weird kustomize errors. I'm not sure off the top of my head what the problem here is |
thanks @everettraven for the review! |
/test pull-kubebuilder-e2e-k8s-1-24-7 |
thanks @camilamacedo86 for re-running the failing build. |
} | ||
return false | ||
} | ||
|
||
// getPluginsRoot detects the host system and gets the plugins root based on the host. | ||
func getPluginsRoot(host string) (pluginsRoot string, err 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.
/hold
func getPluginsRoot(host string) (pluginsRoot string, err error) { | |
func getPluginsRoot(host string) { |
Can we first remove the return since it is not used?
https://github.com/kubernetes-sigs/kubebuilder/pull/3247/files#r1126146318
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.
@camilamacedo86 this function is assigned to retrievePluginsRoot
, and then called by DiscoverExternalPlugins
. the output of the function is indeed used then to lookup external plugins in pluginsRoot
.
to elaborate as to why I've changed return pluginsRoot, nil
to just return
: it's because the function uses named returns, so while using return pluginsRoot, nil
as a return expression would work, specifying the variables would be redundant, so essentially, just using a "void" return
will have the same outcome (because of the named return in the signature).
but either way, I can revert it back to the old style as it would work fine as well. what do you think?
thank you!
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 is fine as it is . We can re-check in a follow up either.
Thank you a lot for your help to address those ones.
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.
thank you @camilamacedo86, always happy to help!
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.
/hold cancel
/lgtm
/approved |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, em-r, everettraven, rashmigottipati 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 |
/test pull-kubebuilder-e2e-k8s-1-26-0 |
This PR aims to fix a bug that's causing external plugin discovery to fail in Linux systems when
XDG_CONFIG_HOME
environment variable is set.fixes: #3224