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

Consolidate CopyFile functions #8079

Merged
merged 2 commits into from
Aug 1, 2023
Merged

Consolidate CopyFile functions #8079

merged 2 commits into from
Aug 1, 2023

Conversation

dereknola
Copy link
Contributor

Proposed Changes

We had two nearly identical CopyFile functions in the K3s codebase. This PR consolidates them into one function.

Types of Changes

DRY

Verification

Testing

Linked Issues

TBD

User-Facing Change


Further Comments

Signed-off-by: Derek Nola <derek.nola@suse.com>
@dereknola dereknola requested a review from a team as a code owner July 31, 2023 17:25
Copy link
Collaborator

@cwayne18 cwayne18 left a comment

Choose a reason for hiding this comment

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

Nice catch

Signed-off-by: Derek Nola <derek.nola@suse.com>
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Patch coverage: 72.22% and project coverage change: +4.55% 🎉

Comparison is base (6d360e6) 47.07% compared to head (8b0ad4b) 51.62%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8079      +/-   ##
==========================================
+ Coverage   47.07%   51.62%   +4.55%     
==========================================
  Files         143      143              
  Lines       14561    14586      +25     
==========================================
+ Hits         6854     7530     +676     
+ Misses       6614     5853     -761     
- Partials     1093     1203     +110     
Flag Coverage Δ
e2etests 49.25% <72.22%> (?)
inttests 44.34% <72.22%> (+<0.01%) ⬆️
unittests 20.05% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pkg/agent/flannel/setup.go 37.90% <0.00%> (ø)
pkg/agent/util/file.go 45.00% <25.00%> (+22.77%) ⬆️
pkg/cli/cert/cert.go 59.81% <92.30%> (+1.30%) ⬆️

... and 43 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dereknola dereknola merged commit 46cbbab into k3s-io:master Aug 1, 2023
11 checks passed
@dereknola dereknola deleted the copy_nit branch August 1, 2023 16:50
dereknola added a commit to dereknola/k3s that referenced this pull request Aug 3, 2023
* Consolidate CopyFile function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Copy to File, not destination folder

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Aug 3, 2023
* Consolidate CopyFile function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Copy to File, not destination folder

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit to dereknola/k3s that referenced this pull request Aug 3, 2023
* Consolidate CopyFile function

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Copy to File, not destination folder

Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Aug 4, 2023
* Unit test for MustFindString (#8013)
* Consolidate CopyFile functions (#8079)
* Remove unnecessary E2E envs
* Cleanup unnecessary "sudo" in commands
* Add additonal s3 coverage clause

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Aug 4, 2023
* Unit test for MustFindString (#8013)
* Consolidate CopyFile functions (#8079)
* Remove unnecessary E2E envs
* Cleanup unnecessary "sudo" in commands
* Add additonal s3 coverage clause

Signed-off-by: Derek Nola <derek.nola@suse.com>
dereknola added a commit that referenced this pull request Aug 4, 2023
* Unit test for MustFindString (#8013)
* Consolidate CopyFile functions (#8079)
* Remove unnecessary E2E envs

Signed-off-by: Derek Nola <derek.nola@suse.com>
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.

None yet

4 participants