Skip to content

Commit

Permalink
add meshkit error
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 2ea056f commit 2ee47ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helpers/component_info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "meshery-istio",
"type": "adapter",
"next_error_code": 1033
"next_error_code": 1034
}
3 changes: 3 additions & 0 deletions istio/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ var (

// ErrLoadNamespaceCode implies error while finding namespace
ErrLoadNamespaceCode = "1032"
// ErrLoadNamespaceCode implies error while finding namespace
ErrFetchIstioVersionsCode = "1032"

ErrFetchIstioVersions = errors.New(ErrFetchIstioVersionsCode, errors.Alert, []string{"could not get any istio versions"}, []string{"versions for istio could not be fetched"}, []string{"could not reach github.com/istio/istio/releases", "no versions could be fetched from istio release page"}, []string{"make sure adapter is reachable to github"})
// ErrOpInvalid represents the errors which are generated
// when an invalid operation is requested
ErrOpInvalid = errors.New(ErrOpInvalidCode, errors.Alert, []string{"Invalid operation"}, []string{"Istio adapter received an invalid operation from the meshey server"}, []string{"The operation is not supported by the adapter", "Invalid operation name"}, []string{"Check if the operation name is valid and supported by the adapter"})
Expand Down
2 changes: 1 addition & 1 deletion istio/istio.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (istio *Istio) ApplyOperation(ctx context.Context, opReq adapter.OperationR
var err error
var stat, version string
if len(operations[opReq.OperationName].Versions) == 0 {
err = fmt.Errorf("no version found for " + internalconfig.IstioOperation)
err = ErrFetchIstioVersions
} 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)
Expand Down

0 comments on commit 2ee47ed

Please sign in to comment.