Skip to content

Support cross device rename - #6738

Merged
mattfarina merged 16 commits into
helm:dev-v2from
ysh7:support-cross-device-rename
Oct 31, 2019
Merged

mattfarina merged 16 commits into
helm:dev-v2from
ysh7:support-cross-device-rename

Conversation

@ysh7

@ysh7 ysh7 commented Oct 22, 2019

Copy link
Copy Markdown
Contributor

This PR includes changes mentioned on #5038 required for merging it.

closes #2998

@helm-bot helm-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 22, 2019
@mattfarina mattfarina added v2.x Issues and Pull Requests related to the major version v2 bug Categorizes issue or PR as related to a bug. Needs v3 backport Label PRs for v4/main, which are still applicable to v3 so need a separate backport PR labels Oct 22, 2019

@mattfarina mattfarina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't expect to see this code again. It's from dep which is a rewrite (with many of the same interfaces) of the same functionality I wrote for Glide.


"github.com/pkg/errors"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment letting us know where this code came from. You can find an example at

// deploymentutil contains a copy of a few functions from Kubernetes controller code to avoid a dependency on k8s.io/kubernetes.
// This code is copied from https://github.com/kubernetes/kubernetes/blob/e856613dd5bb00bcfaca6974431151b5c06cbed5/pkg/controller/deployment/util/deployment_util.go
// No changes to the code were made other than removing some unused functions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added comment

@thomastaylor312

Copy link
Copy Markdown
Contributor

@ysh7 Is there any chance you could also port this to v3? Looks like it should be a pretty simple copy and paste for the third party code and some small changes to the download manager

@ysh7

ysh7 commented Oct 22, 2019

Copy link
Copy Markdown
Contributor Author

@ysh7 Is there any chance you could also port this to v3? Looks like it should be a pretty simple copy and paste for the third party code and some small changes to the download manager

Sure can do that. Will raise PR.

bricerising and others added 16 commits October 23, 2019 01:48
helm dependency upgrade wasn't working on certain file system because it assumes that os.rename is available. Since rename isn't available for subfolders in docker containers, I ripped a fallback rename strategy from dep (https://github.com/golang/dep/blob/5b1fe9e6d89372487d0aac78d9c5362a517857e7/internal/fs/fs.go#L103-L118) that works in docker.

Signed-off-by: Brice Rising <[email protected]>
The fs package tests are going to be a lot of work to get working without the internal test package used by golang/dep, so I removed all of the unused ones by this project to make the work easier.

Signed-off-by: Brice Rising <[email protected]>
Recreated the features of the test package in dep that were necessary to run the tests in the fs package.

Signed-off-by: Brice Rising <[email protected]>
Root can access all files, so the tests for inaccessible files were failing. Now we will skip these tests when running as root.

Signed-off-by: Brice Rising <[email protected]>
Our style settings don't like underscores in variable names, so I switched to camel case. Also, err was unused in some places, so I made an error a fail condition for some test.

Signed-off-by: Brice Rising <[email protected]>
Unused var was in fs.go. Removed it.

Signed-off-by: Brice Rising <[email protected]>
Neeted to run formatting on fs_test.go

Signed-off-by: Brice Rising <[email protected]>
For some reason, gofmt -s -w produced a different result than running gofmt on my host os

Signed-off-by: Brice Rising <[email protected]>
This is probably not the correct apporach to using bsd licensed code under an apache license.

Signed-off-by: Brice Rising <[email protected]>
I found another package that took code from a BSD licensed open source project. I copied their approach for reusing that license.

Signed-off-by: Brice Rising <[email protected]>
Signed-off-by: Brice Rising <[email protected]>
Signed-off-by: Brice Rising <[email protected]>

@thomastaylor312 thomastaylor312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking good from my perspective and testing. I'll let @mattfarina give the final approval since he started the review

@thomastaylor312 thomastaylor312 added the v3 port complete For completed v2->v3 ports label Oct 30, 2019
@thomastaylor312 thomastaylor312 added this to the 2.16.0 milestone Oct 30, 2019
@mattfarina
mattfarina self-requested a review October 31, 2019 14:21
@mattfarina
mattfarina merged commit 7584639 into helm:dev-v2 Oct 31, 2019
@mattfarina mattfarina added needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. and removed needs-pick Indicates that a PR needs to be cherry-picked into the next release candidate. labels Oct 31, 2019
bacongobbler pushed a commit that referenced this pull request Nov 1, 2019
This code was ported over from PR #5038, #6738 which were originally for helm
v2. The code contains functions from golang/dep/internal/fs for renaming files.

Signed-off-by: Yagnesh Mistry <[email protected]>
@gjenkins8 gjenkins8 removed the Needs v3 backport Label PRs for v4/main, which are still applicable to v3 so need a separate backport PR label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Categorizes issue or PR as related to a bug. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. v2.x Issues and Pull Requests related to the major version v2 v3 port complete For completed v2->v3 ports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants