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 committing deleted files #3289

Closed
wants to merge 2 commits into from
Closed

Fix committing deleted files #3289

wants to merge 2 commits into from

Conversation

phillebaba
Copy link
Member

The bootstrap code makes use of some wrapper functions to commit files. It has a workaround for a go-git bug related to broken symlinks. The issue is that this workaround does not take into account deleted files and will fail if one tries to commit a deleted file. Bootstrap will not delete any committed files from git but the Terraform provider will as it tracks the file in the state. This introduces a check which skips the broken symlink test for deleted files.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
Signed-off-by: Philip Laine <philip.laine@gmail.com>
@pjbgf
Copy link
Member

pjbgf commented Nov 7, 2022

go-git using the default go-billy fs has an issue around abs symlinks pointing outside the path of their soft chroot implementation.
We no longer have that issue with our own implementation of go-billy fs: https://github.com/fluxcd/pkg/tree/main/git/gogit/fs.

Based on the above, I am not sure this will be needed once #3273 is finished.
Do you mind giving it a go with the new fs to confirm whether the issues still exists with the Terraform provider?

@pjbgf pjbgf added the area/git Git related issues and pull requests label Nov 7, 2022
@aryan9600
Copy link
Member

@phillebaba i tested deleting committed files using https://github.com/fluxcd/pkg/blob/main/git/gogit/repository_client.go#L241 and its working fine, so i think this can be superseded by #3299 when it gets merged

@phillebaba
Copy link
Member Author

Sounds good will close this PR then and switch when that PR gets merged.

@phillebaba phillebaba closed this Nov 15, 2022
@stefanprodan stefanprodan deleted the fix/commit-deleted branch November 15, 2022 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Git related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants