-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
argo cli should not use os.Getenv("HOME") to find kubeconfig #12850
Comments
It sounds like a reasonable change IMO, we'd just need to be mindful not to accidentally break anything. From what I can see the only place it's used in the CLI is in cluster.go |
@rouke-broersma Are you going to make a PR? |
Hi sorry completely forgot about this. I'm interested in doing this but not sure I can commit to it in the short term. I'll add it to the list in case no one else has picked it up by the time I get there 😅 |
Was a pretty small change, opened a PR for it #14325. Also changed one other location where it was being used. |
…14325) * Replace `os.Getenv("HOME")` with `os.UserHomeDir()` `os.UserHomeDir()` is the recommended way of getting user home directory Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> * Retrigger CI pipeline Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> --------- Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com>
…12850) (argoproj#14325) * Replace `os.Getenv("HOME")` with `os.UserHomeDir()` `os.UserHomeDir()` is the recommended way of getting user home directory Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> * Retrigger CI pipeline Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> --------- Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com>
…12850) (argoproj#14325) * Replace `os.Getenv("HOME")` with `os.UserHomeDir()` `os.UserHomeDir()` is the recommended way of getting user home directory Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> * Retrigger CI pipeline Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com> --------- Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com>
https://github.com/argoproj/argo-cd/blob/ab754052c8f01b90c63f0ef0fe6a2632652969c6/pkg/apis/application/v1alpha1/types.go#LL2571C2-L2571C2
The HOME environment variable is not used on all platforms so is not a good cross-platform solution for finding the home dir. I suggest using https://pkg.go.dev/os#UserHomeDir instead. Am I missing something or is this something I could easily contribute?
I found this because of: https://cloud-native.slack.com/archives/C01TSERG0KZ/p1678778975672349
Please let me now if there's something else going on that make this not an actual problem, or if there's anything I should be mindful of when implementing the improvement.
The text was updated successfully, but these errors were encountered: