diff --git a/cli/internal/state/state.go b/cli/internal/state/state.go index 3fccecce50d..c70094b8c6b 100644 --- a/cli/internal/state/state.go +++ b/cli/internal/state/state.go @@ -22,8 +22,8 @@ import ( "github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider" "github.com/edgelesssys/constellation/v2/internal/constants" "github.com/edgelesssys/constellation/v2/internal/file" + "github.com/edgelesssys/constellation/v2/internal/semver" "github.com/edgelesssys/constellation/v2/internal/validation" - "golang.org/x/mod/semver" ) const ( @@ -564,9 +564,7 @@ func (s *State) Migrate() error { // In v2.13.0 the ClusterEndpoint and InClusterEndpoint fields were added. // So they are expected to be empty when upgrading to this version. // TODO(3u13r): Remove on main after v2.13.0 is released. - isUpgradeToV213 := semver.Compare(constants.BinaryVersion().String(), "v2.13.0") != -1 && - semver.Compare(constants.BinaryVersion().String(), "v2.14.0") == -1 - if isUpgradeToV213 { + if constants.BinaryVersion().MajorMinorEqual(semver.NewFromInt(2, 13, 0, "")) { if s.Infrastructure.InClusterEndpoint == "" { s.Infrastructure.InClusterEndpoint = s.Infrastructure.ClusterEndpoint }