Skip to content

chore: Replace os.Getenv("HOME") with os.UserHomeDir() (#12850)#14325

Merged
jannfis merged 2 commits intoargoproj:masterfrom
aynp:fix-issue-12850-1
Jul 10, 2023
Merged

chore: Replace os.Getenv("HOME") with os.UserHomeDir() (#12850)#14325
jannfis merged 2 commits intoargoproj:masterfrom
aynp:fix-issue-12850-1

Conversation

@aynp
Copy link
Contributor

@aynp aynp commented Jul 3, 2023

os.UserHomeDir() is the recommended way of getting user home directory

Closes #12850

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

Please see Contribution FAQs if you have questions about your pull-request.

`os.UserHomeDir()` is the recommended way of getting user home directory

Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com>
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (d7632df) 49.76% compared to head (10951b0) 49.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14325      +/-   ##
==========================================
- Coverage   49.76%   49.76%   -0.01%     
==========================================
  Files         261      261              
  Lines       44676    44678       +2     
==========================================
  Hits        22232    22232              
- Misses      20257    20259       +2     
  Partials     2187     2187              
Impacted Files Coverage Δ
pkg/apis/application/v1alpha1/types.go 58.93% <0.00%> (-0.19%) ⬇️
util/localconfig/localconfig.go 2.92% <0.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Aryan Pathania <cont-a-pathania@mercari.com>
@aynp aynp marked this pull request as ready for review July 3, 2023 20:05
Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aynp .. The changes look good!!

@blakepettersson blakepettersson added the ready-for-review An approver should give a final review and merge the PR label Jul 6, 2023
Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jannfis jannfis changed the title fix: Replace os.Getenv("HOME") with os.UserHomeDir() (#12850) chore: Replace os.Getenv("HOME") with os.UserHomeDir() (#12850) Jul 10, 2023
@jannfis jannfis merged commit 0564249 into argoproj:master Jul 10, 2023
@aynp aynp deleted the fix-issue-12850-1 branch July 18, 2023 09:56
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…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>
@suzaku suzaku mentioned this pull request Aug 15, 2023
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review An approver should give a final review and merge the PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

argo cli should not use os.Getenv("HOME") to find kubeconfig

4 participants