mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-18 10:21:56 +00:00
Remove the ERROR
level logs in loadOAS
and let the caller handle them in INFO
level (#434)
This commit is contained in:
parent
4009386d82
commit
6811bd5050
@ -13,7 +13,6 @@ import (
|
|||||||
legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
|
legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
|
||||||
|
|
||||||
"github.com/up9inc/mizu/shared"
|
"github.com/up9inc/mizu/shared"
|
||||||
"github.com/up9inc/mizu/shared/logger"
|
|
||||||
"github.com/up9inc/mizu/tap/api"
|
"github.com/up9inc/mizu/tap/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,7 +26,6 @@ func loadOAS(ctx context.Context) (doc *openapi3.T, contractContent string, rout
|
|||||||
path := fmt.Sprintf("%s%s", shared.ConfigDirPath, shared.ContractFileName)
|
path := fmt.Sprintf("%s%s", shared.ConfigDirPath, shared.ContractFileName)
|
||||||
bytes, err := ioutil.ReadFile(path)
|
bytes, err := ioutil.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Error(err.Error())
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
contractContent = string(bytes)
|
contractContent = string(bytes)
|
||||||
@ -35,7 +33,6 @@ func loadOAS(ctx context.Context) (doc *openapi3.T, contractContent string, rout
|
|||||||
doc, _ = loader.LoadFromData(bytes)
|
doc, _ = loader.LoadFromData(bytes)
|
||||||
err = doc.Validate(ctx)
|
err = doc.Validate(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Error(err.Error())
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
router, _ = legacyrouter.NewRouter(doc)
|
router, _ = legacyrouter.NewRouter(doc)
|
||||||
|
Loading…
Reference in New Issue
Block a user