From 7aff459e990f32373923463c47310d81775e0fc4 Mon Sep 17 00:00:00 2001 From: Preslav Date: Mon, 25 Sep 2023 15:30:55 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Trim=20v=20prefix=20from=20version.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/providers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/providers.go b/providers/providers.go index a74963428b..8fedefb0db 100644 --- a/providers/providers.go +++ b/providers/providers.go @@ -181,7 +181,11 @@ func EnsureProvider(existing Providers, connectorName string, connectorType stri } func Install(name string, version string) (*Provider, error) { - if version == "" { + if version != "" { + // we remove the v prefix if passing in a version that looks like 'v9.0.0' + version = strings.TrimPrefix(version, "v") + } else { + // else, if no version is specified, we default to installing the latest one latestVersion, err := LatestVersion(name) if err != nil { return nil, err