From 9f2264ce245fdf25cfb315f25d9ab7884a548ebb Mon Sep 17 00:00:00 2001 From: Cyril Jouve Date: Sun, 10 Dec 2023 12:05:07 +0100 Subject: [PATCH] consistently use Masterminds/semver (#1209) --- go.mod | 2 +- pkg/testutil/mocks.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 23e865d6..9c705996 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/a8m/envsubst v1.3.0 // indirect github.com/aws/aws-sdk-go v1.48.15 github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/blang/semver v3.5.1+incompatible + github.com/blang/semver v3.5.1+incompatible // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fujiwara/tfstate-lookup v1.1.5 // indirect diff --git a/pkg/testutil/mocks.go b/pkg/testutil/mocks.go index 8aaecd59..dd796175 100644 --- a/pkg/testutil/mocks.go +++ b/pkg/testutil/mocks.go @@ -1,7 +1,7 @@ package testutil import ( - "github.com/blang/semver" + "github.com/Masterminds/semver/v3" "helm.sh/helm/v3/pkg/chart" "github.com/helmfile/helmfile/pkg/helmexec" @@ -35,7 +35,7 @@ func (helm *V3HelmExec) IsHelm3() bool { func (helm *VersionHelmExec) IsVersionAtLeast(ver string) bool { currentSemVer := semver.MustParse(helm.version) verSemVer := semver.MustParse(ver) - return currentSemVer.GTE(verSemVer) + return currentSemVer.Compare(verSemVer) >= 0 } func (helm *noCallHelmExec) doPanic() {