Skip to content

Commit

Permalink
Fix #497
Browse files Browse the repository at this point in the history
Signed-off-by: revolyssup <[email protected]>
  • Loading branch information
Revolyssup committed Oct 11, 2022
1 parent bf72830 commit 2ea056f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions istio/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationR
switch opReq.OperationName {
case internalconfig.IstioOperation:
go func(hh *Istio, ee *meshes.EventsResponse) {
version := string(operations[opReq.OperationName].Versions[0])
stat, err := hh.installIstio(opReq.IsDeleteOperation, false, version, opReq.Namespace, "default", kubeConfigs)
var err error
var stat, version string
if len(operations[opReq.OperationName].Versions) == 0 {
err = fmt.Errorf("no version found for " + internalconfig.IstioOperation)
} else {
version = string(operations[opReq.OperationName].Versions[len(operations[opReq.OperationName].Versions)-1])
stat, err = hh.installIstio(opReq.IsDeleteOperation, false, version, opReq.Namespace, "default", kubeConfigs)
}
if err != nil { //Make sure that this is a meshkit error
ee.Summary = fmt.Sprintf("Error while %s Istio service mesh", stat)
ee.Details = err.Error()
Expand Down

0 comments on commit 2ea056f

Please sign in to comment.