mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-20 22:51:47 +00:00
better messaging for pull artifact command
- When there's an error stat'ing the output directory flux now prints the error: Before: ``` ✗ invalid output path ./ro-dir/foo ``` After: ``` ✗ invalid output path "./ro-dir/foo": stat ./ro-dir/foo: permission denied ``` - When no output directory is provided flux now explicitly says so in the error: Before: ``` ✗ invalid output path ``` After: ``` ✗ output path cannot be empty ``` Signed-off-by: Max Jonas Werner <mail@makk.es>
This commit is contained in:
parent
3d1173a2cd
commit
6700aac4a4
1 changed files with 2 additions and 2 deletions
|
|
@ -67,11 +67,11 @@ func pullArtifactCmdRun(cmd *cobra.Command, args []string) error {
|
||||||
ociURL := args[0]
|
ociURL := args[0]
|
||||||
|
|
||||||
if pullArtifactArgs.output == "" {
|
if pullArtifactArgs.output == "" {
|
||||||
return fmt.Errorf("invalid output path %s", pullArtifactArgs.output)
|
return fmt.Errorf("output path cannot be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
if fs, err := os.Stat(pullArtifactArgs.output); err != nil || !fs.IsDir() {
|
if fs, err := os.Stat(pullArtifactArgs.output); err != nil || !fs.IsDir() {
|
||||||
return fmt.Errorf("invalid output path %s", pullArtifactArgs.output)
|
return fmt.Errorf("invalid output path %q: %w", pullArtifactArgs.output, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
url, err := oci.ParseArtifactURL(ociURL)
|
url, err := oci.ParseArtifactURL(ociURL)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue