From 0cdbec2873360d0dc2db5dd76f151d8be5b44fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ole=C5=9B?= Date: Tue, 14 Jan 2025 23:05:12 +0100 Subject: [PATCH] Fix wording for file mounts errors --- go.mod | 2 +- go.sum | 6 ++---- pkg/koyeb/flags_list/file_mounts.go | 8 ++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7b65576..c19418a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gofrs/uuid v4.3.0+incompatible github.com/gorilla/websocket v1.5.0 github.com/iancoleman/strcase v0.2.0 - github.com/koyeb/koyeb-api-client-go v0.0.0-20241206143543-39fbd0d0bf5e + github.com/koyeb/koyeb-api-client-go v0.0.0-20250106150959-2940e5613765 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/manifoldco/promptui v0.9.0 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index 2af6b0c..d5e8c0d 100644 --- a/go.sum +++ b/go.sum @@ -168,12 +168,10 @@ github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/koyeb/koyeb-api-client-go v0.0.0-20241129081540-9cecbc45397f h1:jzyPhhyZgLKA3FXMNxyEZiETROBEde4uI4qwHsliBrk= -github.com/koyeb/koyeb-api-client-go v0.0.0-20241129081540-9cecbc45397f/go.mod h1:+oQfFj2WL3gi9Pb+UHbob4D7xaT52mPfKyH1UvWa4PQ= -github.com/koyeb/koyeb-api-client-go v0.0.0-20241206143120-7817d20778fd h1:krjNLKRYbBEExAIEI1maqyo9P3oF1cKevQXiVedTX18= -github.com/koyeb/koyeb-api-client-go v0.0.0-20241206143120-7817d20778fd/go.mod h1:+oQfFj2WL3gi9Pb+UHbob4D7xaT52mPfKyH1UvWa4PQ= github.com/koyeb/koyeb-api-client-go v0.0.0-20241206143543-39fbd0d0bf5e h1:/pSEDHiuCglPMooi0kcQay0ZmJ1fZys8qre6Jz2iQ7Q= github.com/koyeb/koyeb-api-client-go v0.0.0-20241206143543-39fbd0d0bf5e/go.mod h1:+oQfFj2WL3gi9Pb+UHbob4D7xaT52mPfKyH1UvWa4PQ= +github.com/koyeb/koyeb-api-client-go v0.0.0-20250106150959-2940e5613765 h1:OaJezhu0iuR0XN6y5Sxc6uARWyPx1WG1ZjBgVgG7jvw= +github.com/koyeb/koyeb-api-client-go v0.0.0-20250106150959-2940e5613765/go.mod h1:+oQfFj2WL3gi9Pb+UHbob4D7xaT52mPfKyH1UvWa4PQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= diff --git a/pkg/koyeb/flags_list/file_mounts.go b/pkg/koyeb/flags_list/file_mounts.go index 8e33e9b..8c2dfe1 100644 --- a/pkg/koyeb/flags_list/file_mounts.go +++ b/pkg/koyeb/flags_list/file_mounts.go @@ -58,7 +58,7 @@ func GetNewFilestListFromFlags() func(values []string) ([]Flag[koyeb.File], erro if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { return nil, &kerrors.CLIError{ What: "Error while configuring the service", - Why: fmt.Sprintf("unable to parse the file flag value \"%s\"", hc.cliValue), + Why: fmt.Sprintf(" Unable to locate file at \"%s\"", path), Additional: []string{ "File flag value must be specified as SOURCE:PATH[:PERMISSIONS]", "To remove a mounted file from the service, prefix the path with '!', e.g. '!path'", @@ -71,7 +71,7 @@ func GetNewFilestListFromFlags() func(values []string) ([]Flag[koyeb.File], erro if err != nil { return nil, &kerrors.CLIError{ What: "Error while configuring the service", - Why: fmt.Sprintf("unable to read the file flag value \"%s\"", hc.cliValue), + Why: fmt.Sprintf("unable to read the file \"%s\"", path), Additional: []string{ "File flag value must be specified as SOURCE:PATH[:PERMISSIONS]", "To remove a file mount from the service, prefix it with '!', e.g. '!path'", @@ -89,9 +89,9 @@ func GetNewFilestListFromFlags() func(values []string) ([]Flag[koyeb.File], erro if len(permissions) != 4 { return nil, &kerrors.CLIError{ What: "Error while configuring the service", - Why: fmt.Sprintf("unable to parse the file flag value \"%s\"", hc.cliValue), + Why: fmt.Sprintf("unable to parse the permissions \"%s\"", permissions), Additional: []string{ - "File mount permission must be specified as SOURCE:PATH:PERMISSIONS", + "File mount permission must be specified as SOURCE:PATH:PERMISSIONS and in format like 0644", "To remove a file mount from the service, prefix it with '!', e.g. '!path'", }, Orig: nil,