summaryrefslogtreecommitdiffstats
path: root/client/go
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-03-02 14:31:31 +0100
committerMartin Polden <mpolden@mpolden.no>2022-03-02 14:37:50 +0100
commitda1db1be992f3422b8a0755e11be921d8192e447 (patch)
tree5a7aee736df1c21cd3e10fcbcaf008ce9cc0f864 /client/go
parenta227acd6a1b4fdf3a4afa726ae54c2d77e3b60ab (diff)
Do not check version when running in Vespa Cloud
Diffstat (limited to 'client/go')
-rw-r--r--client/go/cmd/helpers.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/go/cmd/helpers.go b/client/go/cmd/helpers.go
index 9ef40aaff40..0fcb0f6b113 100644
--- a/client/go/cmd/helpers.go
+++ b/client/go/cmd/helpers.go
@@ -194,8 +194,10 @@ func getTarget() (vespa.Target, error) {
if err != nil {
return nil, err
}
- if err := target.CheckVersion(clientVersion); err != nil {
- printErrHint(err, "This is not a fatal error, but this version may not work as expected", "Try 'vespa version' to check for a new version")
+ if !isCloudCI() { // Vespa Cloud always runs an up-to-date version
+ if err := target.CheckVersion(clientVersion); err != nil {
+ printErrHint(err, "This is not a fatal error, but this version may not work as expected", "Try 'vespa version' to check for a new version")
+ }
}
return target, nil
}
@@ -348,6 +350,12 @@ func isCI() bool {
return ok
}
+// isCloudCI returns true if running inside a Vespa Cloud deployment job.
+func isCloudCI() bool {
+ _, ok := os.LookupEnv("VESPA_CLI_CLOUD_CI")
+ return ok
+}
+
type endpoints struct {
Endpoints []endpoint `json:"endpoints"`
}