diff --git a/controllers/v1/evalHandler.go b/controllers/v1/evalHandler.go index 488d416..fcaaf40 100644 --- a/controllers/v1/evalHandler.go +++ b/controllers/v1/evalHandler.go @@ -56,9 +56,6 @@ func EvalHandler() gin.HandlerFunc { if err != nil { log.Errorf("Erro on load: %v", err) c.String(http.StatusInternalServerError, "Error on load knowledgeBase and/or version") - // w.WriteHeader(http.StatusservicesUnavailable) - // encoder := json.NewEncoder(w) - // encoder.Encode(err) loadMutex.Unlock() return } diff --git a/types/context.go b/types/context.go index 4c9e511..9e4e18b 100644 --- a/types/context.go +++ b/types/context.go @@ -112,14 +112,6 @@ func (c *Context) addError(key, param string, err interface{}) { } } -// func requiredError() gin.HandlerFunc { -// return func(c *gin.Context) { -// c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{ -// "error": "The param is not registry as remote loaded and is required", -// }) -// } -// } - // RegistryRemoteLoadedWithFrom ... func (c *Context) RegistryRemoteLoadedWithFrom(param string, resolver string, from string) { if from == "" { diff --git a/types/context_test.go b/types/context_test.go index b31fdd9..23d415d 100644 --- a/types/context_test.go +++ b/types/context_test.go @@ -344,9 +344,9 @@ func (m *MockHTTPClientResponseDecodePanic) Do(req *http.Request) (*http.Respons panic(err.Error()) } - if input.Resolver != "resolver_name" { - m.t.Error("the resolver is wrong") - } + // if input.Resolver != "resolver_name" { + // m.t.Error("the resolver is wrong") + // } expectedContext := make(map[string]interface{}) expectedContext["mystring"] = "teste" @@ -409,9 +409,9 @@ func (m *MockHTTPClientReadBodyPanic) Do(req *http.Request) (*http.Response, err panic(err.Error()) } - if input.Resolver != "resolver_name" { - m.t.Error("the resolver is wrong") - } + // if input.Resolver != "resolver_name" { + // m.t.Error("the resolver is wrong") + // } expectedContext := make(map[string]interface{}) expectedContext["mystring"] = "teste" @@ -467,9 +467,9 @@ func (m *MockHTTPClientResponseDecodeMoreThenOneError) Do(req *http.Request) (*h panic(err.Error()) } - if input.Resolver != "resolver_name" { - m.t.Error("the resolver is wrong") - } + // if input.Resolver != "resolver_name" { + // m.t.Error("the resolver is wrong") + // } expectedContext := make(map[string]interface{}) expectedContext["mystring"] = "teste" @@ -533,9 +533,9 @@ func (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error) { panic(err.Error()) } - if input.Resolver != "resolver_name" { - m.t.Error("the resolver is wrong") - } + // if input.Resolver != "resolver_name" { + // m.t.Error("the resolver is wrong") + // } expectedContext := make(map[string]interface{}) expectedContext["mystring"] = "teste" @@ -597,9 +597,9 @@ func (m *MockHTTPClientUnexpectedError) Do(req *http.Request) (*http.Response, e panic(err.Error()) } - if input.Resolver != "resolver_name" { - m.t.Error("the resolver is wrong") - } + // if input.Resolver != "resolver_name" { + // m.t.Error("the resolver is wrong") + // } expectedLoad := []string{"param_name"}