Skip to content

Commit 78235de

Browse files
authored
validate agent config (#567)
1 parent 104fdf9 commit 78235de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/agentfs/config-file.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"path/filepath"
2222

2323
"github.com/BurntSushi/toml"
24+
2425
"github.com/livekit/protocol/logger"
2526
)
2627

@@ -73,5 +74,12 @@ func LoadTomlFile(dir string, tomlFileName string) (*AgentTOML, bool, error) {
7374
}
7475
}
7576

77+
if configExists {
78+
// validate config
79+
if agentConfig.Replicas > agentConfig.MaxReplicas {
80+
return nil, configExists, fmt.Errorf("replicas cannot be greater than max_replicas")
81+
}
82+
}
83+
7684
return &agentConfig, configExists, err
7785
}

0 commit comments

Comments
 (0)