Skip to content

Commit

Permalink
Merge pull request #662 from rancher/fix-version
Browse files Browse the repository at this point in the history
Trim version string
  • Loading branch information
dbason authored Oct 13, 2022
2 parents fd27a0a + e2a41bf commit cbd319f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/logging/pkg/gateway/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"net/http"
"regexp"
"strings"
"time"

"github.com/lestrrat-go/backoff/v2"
Expand Down Expand Up @@ -173,7 +174,7 @@ func (p *Plugin) CreateOrUpdateOpensearchCluster(
if p.version != "" {
return p.version
}
return util.Version
return strings.TrimPrefix(util.Version, "v")
}(),
ImageRepo: "docker.io/rancher",
NatsRef: p.natsRef,
Expand Down Expand Up @@ -211,7 +212,7 @@ func (p *Plugin) CreateOrUpdateOpensearchCluster(
func (p *Plugin) UpgradeAvailable(context.Context, *emptypb.Empty) (*loggingadmin.UpgradeAvailableResponse, error) {
k8sOpensearchCluster := &loggingv1beta1.OpniOpensearch{}
var version string
version = util.Version
version = strings.TrimPrefix(util.Version, "v")
if p.version != "" {
version = p.version
}
Expand Down Expand Up @@ -255,7 +256,7 @@ func (p *Plugin) DoUpgrade(context.Context, *emptypb.Empty) (*emptypb.Empty, err
}

var version string
version = util.Version
version = strings.TrimPrefix(util.Version, "v")
if p.version != "" {
version = p.version
}
Expand Down Expand Up @@ -373,7 +374,7 @@ func (p *Plugin) convertProtobufToDashboards(
version := "0.6.0-rc3"
if cluster == nil {
if util.Version != "unversioned" {
version = util.Version
version = strings.TrimPrefix(util.Version, "v")
}
if p.version != "" {
version = p.version
Expand All @@ -383,7 +384,7 @@ func (p *Plugin) convertProtobufToDashboards(
if cluster.Status.Version != nil {
version = *cluster.Status.Version
} else {
version = util.Version
version = strings.TrimPrefix(util.Version, "v")
if p.version != "" {
version = p.version
}
Expand Down

0 comments on commit cbd319f

Please sign in to comment.