Skip to content

Commit 91e9a21

Browse files
committed
Only define an empty default route if no route is set AND a subconfig is
used
1 parent a2c6f11 commit 91e9a21

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/utils/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ func parseSubConfig(config *Config, subconfig *subConfig) error {
169169
}
170170

171171
// merge routes
172+
if config.Routes == nil {
173+
config.Routes = defaultRoutes
174+
}
172175
for service, opts := range subconfig.Routes {
173176
config.Routes[service] = opts
174177
}
@@ -228,10 +231,6 @@ func LoadConfig(filename, currentUsername, sid string, start time.Time, groups m
228231
config.SSH.Args = defaultSSHArgs
229232
}
230233

231-
if config.Routes == nil {
232-
config.Routes = defaultRoutes
233-
}
234-
235234
// we have to use a slice of maps in order to have ordered maps
236235
for _, groupconfigs := range config.Groups {
237236
for groupnames, groupconfig := range groupconfigs {

0 commit comments

Comments
 (0)