-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix: Generic Worker: Process absolute paths in task payload corre…
…ctly Generic Worker now evaluates absolute paths inside `mounts` (properties `directory` and `file`) and artifacts (property `path`) correctly. Previously Generic Worker would effectively strip leading path separators and treat them as relative paths inside the task directory. For example, `/tmp` would be resolved as the relative path `tmp` from inside the task directory. This has now been fixed, so that both absolute and relative paths are evaluated correctly.
- Loading branch information
Showing
13 changed files
with
94 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
audience: users | ||
level: major | ||
reference: issue 6689 | ||
--- | ||
Bug fix: Generic Worker now evaluates absolute paths inside `mounts` | ||
(properties `directory` and `file`) and artifacts (property `path`) correctly. | ||
Previously Generic Worker would effectively strip leading path separators and | ||
treat them as relative paths inside the task directory. For example, `/tmp` | ||
would be resolved as the relative path `tmp` from inside the task directory. | ||
This has now been fixed, so that both absolute and relative paths are evaluated | ||
correctly. |
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
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,15 @@ | ||
package fileutil | ||
|
||
import ( | ||
"path/filepath" | ||
) | ||
|
||
// AbsFrom returns path if an absolute path, otherwise the result of joining it | ||
// to the parent path. This mimics filepath.Abs(path) without restricting | ||
// parent to the current working directory. | ||
func AbsFrom(parent string, path string) string { | ||
if filepath.IsAbs(path) { | ||
return path | ||
} | ||
return filepath.Join(parent, path) | ||
} |
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
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
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