containers without port mapped will no longer be served

This commit is contained in:
yusing
2024-10-01 17:18:17 +08:00
parent 44cfd65f6c
commit c3b779a810
11 changed files with 50 additions and 48 deletions

View File

@@ -27,6 +27,9 @@ func (cfg *Config) DumpProviders() map[string]*PR.Provider {
func (cfg *Config) RoutesByAlias() map[string]U.SerializedObject {
routes := make(map[string]U.SerializedObject)
cfg.forEachRoute(func(alias string, r R.Route, p *PR.Provider) {
if !r.Started() {
return
}
obj, err := U.Serialize(r)
if err.HasError() {
cfg.l.Error(err)
@@ -46,6 +49,9 @@ func (cfg *Config) Statistics() map[string]any {
providerStats := make(map[string]any)
cfg.forEachRoute(func(alias string, r R.Route, p *PR.Provider) {
if !r.Started() {
return
}
s, ok := providerStats[p.GetName()]
if !ok {
s = make(map[string]int)