fix: edit original file if the given skaffold path is a symlink - #8955
Merged
Conversation
renzodavid9
self-requested a review
July 19, 2023 14:35
renzodavid9
reviewed
Jul 19, 2023
Contributor
|
Hey @alphanota, thanks for the PR. Could you please change the PR's title and the commit message to follow the conventionalcommits.org? We have a linter that checks that. Something like the following will work: Thanks! |
Codecov Report
@@ Coverage Diff @@
## main #8955 +/- ##
==========================================
- Coverage 70.48% 63.66% -6.83%
==========================================
Files 515 624 +109
Lines 23150 31926 +8776
==========================================
+ Hits 16317 20325 +4008
- Misses 5776 10076 +4300
- Partials 1057 1525 +468
... and 415 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Contributor
|
LGTM, let's wait for the tests to finish before merging this. Thanks! |
renzodavid9
approved these changes
Jul 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #8489
Related: Relevant tracking issues, for context
Merge before/after: Dependent or prerequisite PRs
Description
This PR fixes issue where skaffold fix --overwrite command doesn't overwrite the contents of a symlink
First we make a backup of original file by copying the contents of symlink to new file (in same directory as symlink, if applicable)
Then we overwrite config file with new contents
This also accounts for case where symlink of symlink is provided.
User facing changes (remove if N/A)
Setup:
$ $HOME/skaffold/out/skaffold fix --overwrite
Backed up previous skaffold.yaml at skaffold.yaml.v2
New config at version skaffold/v4beta6 generated and written to skaffold.yaml