Skip to content

Commit

Permalink
chore(deps): Update github.com/Masterminds/semver to v3.1.1 (#8180)
Browse files Browse the repository at this point in the history
* chore(deps): Upgrade Masterminds/semver to v3.1.1

Signed-off-by: jannfis <jann@mistrust.net>

* Do not anchor regexp

Signed-off-by: jannfis <jann@mistrust.net>
  • Loading branch information
jannfis authored Jan 14, 2022
1 parent 0b9b7c3 commit cb47740
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/semver/v3 v3.1.1
github.com/TomOnTime/utfutil v0.0.0-20180511104225-09c41003ee1d
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/alicebob/miniredis/v2 v2.14.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RP
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
Expand Down
2 changes: 1 addition & 1 deletion reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/argoproj/argo-cd/v2/util/argo"

"github.com/Masterminds/semver"
"github.com/Masterminds/semver/v3"
"github.com/TomOnTime/utfutil"
"github.com/argoproj/gitops-engine/pkg/utils/kube"
textutils "github.com/argoproj/gitops-engine/pkg/utils/text"
Expand Down
2 changes: 1 addition & 1 deletion util/grpc/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package grpc
import (
"strings"

"github.com/Masterminds/semver"
"github.com/Masterminds/semver/v3"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion util/helm/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

log "github.com/sirupsen/logrus"

"github.com/Masterminds/semver"
"github.com/Masterminds/semver/v3"
)

type Entry struct {
Expand Down
2 changes: 1 addition & 1 deletion util/helm/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package helm
import (
"testing"

"github.com/Masterminds/semver"
"github.com/Masterminds/semver/v3"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion util/helm/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package helm

import "github.com/Masterminds/semver"
import "github.com/Masterminds/semver/v3"

func IsVersion(text string) bool {
_, err := semver.NewVersion(text)
Expand Down
11 changes: 9 additions & 2 deletions util/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"sync"

"github.com/Masterminds/semver"
"github.com/Masterminds/semver/v3"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
"github.com/pkg/errors"
Expand Down Expand Up @@ -223,9 +223,16 @@ func IsKustomization(path string) bool {
return false
}

// semver/v3 doesn't export the regexp anymore, so shamelessly copied it over to
// here.
// https://github.com/Masterminds/semver/blob/49c09bfed6adcffa16482ddc5e5588cffff9883a/version.go#L42
const semVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
`(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
`(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?`

var (
unknownVersion = semver.MustParse("v99.99.99")
semverRegex = regexp.MustCompile(semver.SemVerRegex)
semverRegex = regexp.MustCompile(semVerRegex)
semVer *semver.Version
semVerLock sync.Mutex
)
Expand Down

0 comments on commit cb47740

Please sign in to comment.