decouple bouncer dependencies: use go-cs-lib/pkg/* (#2216)

* decouple bouncer dependencies: use go-cs-lib/pkg/trace
* decouple bouncer dependencies: use go-cs-lib/pkg/version
* decouple bouncer dependencies: use go-cs-lib/pkg/yamlpatch
* decouple bouncer dependencies: use go-cs-lib/pkg/csstring
* unused import
This commit is contained in:
mmetc 2023-05-23 10:52:47 +02:00 committed by GitHub
parent eddb994c0b
commit 534328ca30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 191 additions and 1297 deletions

View file

@ -12,6 +12,8 @@ import (
"strings"
"time"
"github.com/crowdsecurity/go-cs-lib/pkg/trace"
"github.com/crowdsecurity/crowdsec/pkg/apiclient"
"github.com/crowdsecurity/crowdsec/pkg/apiserver/controllers"
v1 "github.com/crowdsecurity/crowdsec/pkg/apiserver/middlewares/v1"
@ -87,7 +89,7 @@ func CustomRecoveryWithWriter() gin.HandlerFunc {
log.Warningf("client %s disconnected : %s", c.ClientIP(), err)
c.Abort()
} else {
filename := types.WriteStackTrace(err)
filename := trace.WriteStackTrace(err)
log.Warningf("client %s error : %s", c.ClientIP(), err)
log.Warningf("stacktrace written to %s, please join to your issue", filename)
c.AbortWithStatus(http.StatusInternalServerError)
@ -325,7 +327,7 @@ func (s *APIServer) GetTLSConfig() (*tls.Config, error) {
}
func (s *APIServer) Run(apiReady chan bool) error {
defer types.CatchPanic("lapi/runServer")
defer trace.CatchPanic("lapi/runServer")
tlsCfg, err := s.GetTLSConfig()
if err != nil {
return errors.Wrap(err, "while creating TLS config")