diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-11-26 15:09:40 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-11-26 15:09:40 +0100 |
commit | 1b7cc92fe19468818163a392cd2ca3e02ec41d67 (patch) | |
tree | ee152046de9ff8f8e04d7f4554496a0865e526a9 /client | |
parent | 9790a9a832394e8e3c48c44fbbc77eff7e669bc3 (diff) |
Use right file, and right path trimming
Diffstat (limited to 'client')
-rw-r--r-- | client/go/cmd/prod.go | 4 | ||||
-rw-r--r-- | client/go/vespa/deploy.go | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/client/go/cmd/prod.go b/client/go/cmd/prod.go index a46a158e3b8..89dc4cb6094 100644 --- a/client/go/cmd/prod.go +++ b/client/go/cmd/prod.go @@ -140,7 +140,9 @@ $ vespa prod submit`, return } if pkg.TestPath == "" { - fatalErrHint(fmt.Errorf("No tests found"), "The application must be a Java maven project, or include basic HTTP tests under src/test/application/") + fatalErrHint(fmt.Errorf("No tests found"), + "The application must be a Java maven project, or include basic HTTP tests under src/test/application/", + "See https://cloud.vespa.ai/en/reference/getting-to-production") return } else { verifyTests(pkg.TestPath, target) diff --git a/client/go/vespa/deploy.go b/client/go/vespa/deploy.go index 14158453c96..741b45f9e15 100644 --- a/client/go/vespa/deploy.go +++ b/client/go/vespa/deploy.go @@ -139,7 +139,7 @@ func (ap *ApplicationPackage) zipReader(test bool) (io.ReadCloser, error) { tempZip.Close() os.Remove(tempZip.Name()) }() - if err := zipDir(ap.Path, tempZip.Name()); err != nil { + if err := zipDir(zipFile, tempZip.Name()); err != nil { return nil, err } zipFile = tempZip.Name() @@ -444,7 +444,10 @@ func zipDir(dir string, destination string) error { } defer file.Close() - zippath := strings.TrimPrefix(path, dir) + zippath, err := filepath.Rel(dir, path) + if err != nil { + return err + } zipfile, err := w.Create(zippath) if err != nil { return err |