Do not check version when running in Vespa Cloud
@@ -194,9 +194,11 @@ func getTarget() (vespa.Target, error) {
if err != nil {
return nil, err
}
+ 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"`
}
