Skip to content
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

fix(#9963):Add logic to handle for f.Close() for cmd/argocd/commands/admin #10074

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

my-git9
Copy link
Member

@my-git9 my-git9 commented Jul 21, 2022

part of issue: #9963

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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).
  • 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).

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #10074 (09e0413) into master (5c08527) will not change coverage.
The diff coverage is n/a.

❗ Current head 09e0413 differs from pull request most recent head a73d014. Consider uploading reports for the commit a73d014 to get more accurate results

@@           Coverage Diff           @@
##           master   #10074   +/-   ##
=======================================
  Coverage   45.89%   45.89%           
=======================================
  Files         227      227           
  Lines       27353    27353           
=======================================
  Hits        12555    12555           
  Misses      13095    13095           
  Partials     1703     1703           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c08527...a73d014. Read the comment docs.

defer f.Close()
defer func() {
if err = f.Close(); err != nil {
fmt.Printf("error closing file %q: %v", f.Name(), err)
Copy link
Member

Choose a reason for hiding this comment

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

Since this is a test, can you panic instead of just logging the error? That'll help us avoid temp files piling up on any machine that's repeatedly running tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, thx

Signed-off-by: xin.li <xin.li@daocloud.io>
@crenshaw-dev crenshaw-dev enabled auto-merge (squash) July 28, 2022 14:24
@crenshaw-dev crenshaw-dev merged commit ea5063d into argoproj:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants