Skip to content

Commit 41fe227

Browse files
committed
Trimming v prefix from suse product string
1 parent a4627af commit 41fe227

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/manager/types.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package manager
22

33
import (
44
"fmt"
5+
"strings"
56

67
"github.com/rancher/csp-adapter/pkg/clients/k8s"
78
)
@@ -47,5 +48,7 @@ func GetDefaultSupportConfig(client k8s.Client) CSPSupportConfig {
4748
}
4849

4950
func createProductString(rancherVersion string) string {
50-
return fmt.Sprintf("cpe:/o:suse:rancher:%s", rancherVersion)
51+
// rancher version that comes from k8s is prefixed with a v, but suse lists the product version without a v
52+
productVersion := strings.TrimPrefix(rancherVersion, "v")
53+
return fmt.Sprintf("cpe:/o:suse:rancher:%s", productVersion)
5154
}

0 commit comments

Comments
 (0)