-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tk tool importers
: Handle deleted files (#872)
* `tk tool importers`: Handle deleted files One of the issues we are facing with this command is whenever someone deletes a file and it's still being used somewhere: - We can't pass this file to the `importers` command because it will fail trying to find symlinks - Jsonnet main files which are using this file will not be found - We end up with erroring projects that are only found out the next time they are evaluated This PR adds support for deleted files via a `deleted:` prefix that can be added to files that were deleted. In that case, a simple filepath.Abs logic is used instead of trying to find symlinks and the same import resolution process happens as with existing files Ex: ```console tk tool importers deleted:lib/external-secrets/main.libsonnet ``` * Rename var to make function clearer
- Loading branch information
1 parent
e264b4d
commit e0bb1eb
Showing
4 changed files
with
111 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
3 changes: 3 additions & 0 deletions
3
pkg/jsonnet/testdata/findImporters/environments/using-deleted-stuff/main.jsonnet
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
myimport: import 'my-import-dir/main.libsonnet', | ||
} |