Skip to content

Commit d207fe9

Browse files
authored
Merge pull request #450 from Revolyssup/fix#441
Fix failed linkerd installation with MeshOps V1
2 parents f7671d2 + e4a69aa commit d207fe9

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

internal/config/operations.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package config
1717
import (
1818
"github.com/layer5io/meshery-adapter-library/adapter"
1919
"github.com/layer5io/meshery-adapter-library/meshes"
20+
"github.com/layer5io/meshkit/utils"
2021
)
2122

2223
var (
@@ -25,7 +26,8 @@ var (
2526

2627
func getOperations(dev adapter.Operations) adapter.Operations {
2728
var adapterVersions []adapter.Version
28-
versions, _ := GetLatestReleaseNames(30)
29+
30+
versions, _ := utils.GetLatestReleaseTagsSorted("linkerd", "linkerd2")
2931
for _, v := range versions {
3032
adapterVersions = append(adapterVersions, adapter.Version(v))
3133
}

linkerd/install.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ func (linkerd *Linkerd) installLinkerd(del bool, version, namespace string, kube
8383
return status.Installed, nil
8484
}
8585

86-
func (linkerd *Linkerd) applyHelmChart(version string, namespace string, isDel bool, kubeconfigs []string) error {
87-
loc, cver := getChartLocationAndVersion(version)
88-
if loc == "" || cver == "" {
86+
func (linkerd *Linkerd) applyHelmChart(appversion string, namespace string, isDel bool, kubeconfigs []string) error {
87+
loc, ver := getChartLocationAndVersion(appversion)
88+
if loc == "" || ver == "" {
8989
return ErrInvalidVersionForMeshInstallation
9090
}
91-
91+
cver, err := mesherykube.HelmAppVersionToChartVersion(loc, "linkerd2", ver)
92+
if err != nil {
93+
return ErrApplyHelmChart(err)
94+
}
9295
// Generate certificates for linkerd
9396
c, pk, err := cert.GenerateRootCAWithDefaults("cluster.local")
9497
if err != nil {
@@ -187,11 +190,11 @@ func (linkerd *Linkerd) applyHelmChart(version string, namespace string, isDel b
187190

188191
func getChartLocationAndVersion(version string) (string, string) {
189192
if strings.HasPrefix(version, "edge-") {
190-
return LinkerdHelmEdgeRepo, strings.TrimPrefix(version, "edge-")
193+
return LinkerdHelmEdgeRepo, version
191194
}
192195

193196
if strings.HasPrefix(version, "stable-") {
194-
return LinkerdHelmStableRepo, strings.TrimPrefix(version, "stable-")
197+
return LinkerdHelmStableRepo, version
195198
}
196199

197200
return "", ""

0 commit comments

Comments
 (0)