1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-29 21:48:14 +02:00

Improve agent backend loading and suppress expectable errors (#818)

* improve agent loop loading backend once

* supress container not found or stopped warnings
This commit is contained in:
Anbraten
2022-03-08 16:21:43 +01:00
committed by GitHub
parent 32d56ed795
commit e178b7b4b2
3 changed files with 38 additions and 28 deletions

View File

@@ -10,16 +10,15 @@ import (
var engines map[string]types.Engine
func init() {
loadedEngines := []types.Engine{
docker.New(),
// kubernetes.New(), // TODO: disabled for now as kubernetes backend has not been implemented yet
}
engines = make(map[string]types.Engine)
// TODO: disabled for now as kubernetes backend has not been implemented yet
// kubernetes
// engine = kubernetes.New("", "", "")
// engines[engine.Name()] = engine
// docker
engine := docker.New()
engines[engine.Name()] = engine
for _, engine := range loadedEngines {
engines[engine.Name()] = engine
}
}
func FindEngine(engineName string) (types.Engine, error) {