summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-20 22:27:30 +0100
committerGitHub <noreply@github.com>2023-12-20 22:27:30 +0100
commitfc4d21db12894fa8056f03c091b7cbc756da3d6f (patch)
treee64b166dc7bdec39157d23d5c049b622c63ab92d /client
parent65be04820cda0d06b8d2c7f7212f814a5ef434f3 (diff)
parent57595d4ee49e13ad5183361b0c6e4c8a250c6d3f (diff)
Merge branch 'master' into balder/gc-unused-feature-flags
Diffstat (limited to 'client')
-rw-r--r--client/go/internal/cli/cmd/root.go7
-rw-r--r--client/go/internal/cli/cmd/status.go6
-rw-r--r--client/go/internal/cli/cmd/status_test.go8
-rw-r--r--client/go/internal/vespa/target.go4
-rw-r--r--client/js/app/yarn.lock38
5 files changed, 36 insertions, 27 deletions
diff --git a/client/go/internal/cli/cmd/root.go b/client/go/internal/cli/cmd/root.go
index 383ce7dd28d..8e0f3de4f72 100644
--- a/client/go/internal/cli/cmd/root.go
+++ b/client/go/internal/cli/cmd/root.go
@@ -69,6 +69,7 @@ type CLI struct {
// the error.
type ErrCLI struct {
Status int
+ warn bool
quiet bool
hints []string
error
@@ -599,7 +600,11 @@ func (c *CLI) Run(args ...string) error {
if err != nil {
if cliErr, ok := err.(ErrCLI); ok {
if !cliErr.quiet {
- c.printErr(cliErr, cliErr.hints...)
+ if cliErr.warn {
+ c.printWarning(cliErr, cliErr.hints...)
+ } else {
+ c.printErr(cliErr, cliErr.hints...)
+ }
}
} else {
c.printErr(err)
diff --git a/client/go/internal/cli/cmd/status.go b/client/go/internal/cli/cmd/status.go
index 29a4a5775db..6056ee439b2 100644
--- a/client/go/internal/cli/cmd/status.go
+++ b/client/go/internal/cli/cmd/status.go
@@ -176,7 +176,11 @@ $ vespa status deployment -t local [session-id] --wait 600
waiter := cli.waiter(time.Duration(waitSecs) * time.Second)
id, err := waiter.Deployment(t, wantedID)
if err != nil {
- return err
+ var hints []string
+ if waiter.Timeout == 0 {
+ hints = []string{"Consider using the --wait flag to wait for completion"}
+ }
+ return ErrCLI{Status: 1, warn: true, hints: hints, error: err}
}
if t.IsCloud() {
log.Printf("Deployment run %s has completed", color.CyanString(strconv.FormatInt(id, 10)))
diff --git a/client/go/internal/cli/cmd/status_test.go b/client/go/internal/cli/cmd/status_test.go
index 3c6277b9050..5ef96c462d8 100644
--- a/client/go/internal/cli/cmd/status_test.go
+++ b/client/go/internal/cli/cmd/status_test.go
@@ -85,7 +85,7 @@ func TestStatusError(t *testing.T) {
cli.httpClient = client
assert.NotNil(t, cli.Run("status", "container"))
assert.Equal(t,
- "Container default at http://127.0.0.1:8080 is not ready: unhealthy container default: status 500 at http://127.0.0.1:8080/status.html: wait timed out\n",
+ "Container default at http://127.0.0.1:8080 is not ready: unhealthy container default: status 500 at http://127.0.0.1:8080/status.html: giving up\n",
stdout.String())
assert.Equal(t,
"Error: services not ready: default\n",
@@ -122,13 +122,13 @@ func TestStatusLocalDeployment(t *testing.T) {
resp.Body = []byte(`{"currentGeneration": 42, "converged": false}`)
client.NextResponse(resp)
assert.NotNil(t, cli.Run("status", "deployment"))
- assert.Equal(t, "Error: deployment not converged on latest generation: wait timed out\n", stderr.String())
+ assert.Equal(t, "Warning: deployment not converged on latest generation: giving up\nHint: Consider using the --wait flag to wait for completion\n", stderr.String())
// Explicit generation
stderr.Reset()
client.NextResponse(resp)
assert.NotNil(t, cli.Run("status", "deployment", "41"))
- assert.Equal(t, "Error: deployment not converged on generation 41: wait timed out\n", stderr.String())
+ assert.Equal(t, "Warning: deployment not converged on generation 41: giving up\nHint: Consider using the --wait flag to wait for completion\n", stderr.String())
}
func TestStatusCloudDeployment(t *testing.T) {
@@ -164,7 +164,7 @@ func TestStatusCloudDeployment(t *testing.T) {
Body: []byte(`{"active": false, "status": "failure"}`),
})
assert.NotNil(t, cli.Run("status", "deployment", "42", "-w", "10"))
- assert.Equal(t, "Waiting up to 10s for deployment to converge...\nError: deployment run 42 incomplete after waiting up to 10s: aborting wait: run 42 ended with unsuccessful status: failure\n", stderr.String())
+ assert.Equal(t, "Waiting up to 10s for deployment to converge...\nWarning: deployment run 42 incomplete after waiting up to 10s: aborting wait: run 42 ended with unsuccessful status: failure\n", stderr.String())
}
func isLocalTarget(args []string) bool {
diff --git a/client/go/internal/vespa/target.go b/client/go/internal/vespa/target.go
index 543ce2f4a29..90d1e1997da 100644
--- a/client/go/internal/vespa/target.go
+++ b/client/go/internal/vespa/target.go
@@ -36,7 +36,7 @@ const (
AnyDeployment int64 = -2
)
-var errWaitTimeout = errors.New("wait timed out")
+var errWaitTimeout = errors.New("giving up")
var errAuth = errors.New("auth failed")
// Authenticator authenticates the given HTTP request.
@@ -255,7 +255,7 @@ func wait(service *Service, okFn responseFunc, reqFn requestFunc, timeout, retry
deadline := time.Now().Add(timeout)
loopOnce := timeout == 0
for time.Now().Before(deadline) || loopOnce {
- response, err = service.Do(reqFn(), 10*time.Second)
+ response, err = service.Do(reqFn(), 20*time.Second)
if errors.Is(err, errAuth) {
return status, fmt.Errorf("aborting wait: %w", err)
} else if err == nil {
diff --git a/client/js/app/yarn.lock b/client/js/app/yarn.lock
index dff60b31ec5..c06265edaa1 100644
--- a/client/js/app/yarn.lock
+++ b/client/js/app/yarn.lock
@@ -1204,7 +1204,7 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
-"@pkgr/utils@^2.3.1":
+"@pkgr/utils@^2.4.2":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc"
integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==
@@ -1900,9 +1900,9 @@ base@^0.11.1:
pascalcase "^0.1.1"
big-integer@^1.6.44:
- version "1.6.51"
- resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686"
- integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==
+ version "1.6.52"
+ resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85"
+ integrity sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==
bplist-parser@^0.2.0:
version "0.2.0"
@@ -2564,9 +2564,9 @@ eslint-plugin-import@^2:
tsconfig-paths "^3.15.0"
eslint-plugin-prettier@^5:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz#a3b399f04378f79f066379f544e42d6b73f11515"
- integrity sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.0.tgz#f14bb2b18756ad54f1ad3dc4c989cb73dfa326a3"
+ integrity sha512-hQc+2zbnMeXcIkg+pKZtVa+3Yqx4WY7SMkn1PLZ4VbBEU7jJIpVn9347P8BBhTbz6ne85aXvQf30kvexcqBeWw==
dependencies:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.5"
@@ -2842,9 +2842,9 @@ fast-diff@^1.1.2:
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
fast-glob@^3.3.0:
- version "3.3.1"
- resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4"
- integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
+ integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
@@ -2863,9 +2863,9 @@ fast-levenshtein@^2.0.6:
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
fastq@^1.6.0:
- version "1.15.0"
- resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a"
- integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==
+ version "1.16.0"
+ resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.16.0.tgz#83b9a9375692db77a822df081edb6a9cf6839320"
+ integrity sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==
dependencies:
reusify "^1.0.4"
@@ -5442,12 +5442,12 @@ supports-preserve-symlinks-flag@^1.0.0:
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
synckit@^0.8.5:
- version "0.8.5"
- resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3"
- integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==
+ version "0.8.6"
+ resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.6.tgz#b69b7fbce3917c2673cbdc0d87fb324db4a5b409"
+ integrity sha512-laHF2savN6sMeHCjLRkheIU4wo3Zg9Ln5YOjOo7sZ5dVQW8yF5pPE5SIw1dsPhq3TRp1jisKRCdPhfs/1WMqDA==
dependencies:
- "@pkgr/utils" "^2.3.1"
- tslib "^2.5.0"
+ "@pkgr/utils" "^2.4.2"
+ tslib "^2.6.2"
tabbable@^6.0.1:
version "6.2.0"
@@ -5525,7 +5525,7 @@ tsconfig-paths@^3.15.0:
minimist "^1.2.6"
strip-bom "^3.0.0"
-tslib@^2.0.0, tslib@^2.5.0, tslib@^2.6.0:
+tslib@^2.0.0, tslib@^2.6.0, tslib@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==