fix: add --config-file to wcli in patchPaths for multi-instance

This commit is contained in:
admin 2026-08-02 08:41:20 +00:00
parent f4e931bbd4
commit 86a172a4ed

View file

@ -255,11 +255,13 @@ func patchPaths(dir string) {
exec.Command("bash", "-c", exec.Command("bash", "-c",
fmt.Sprintf("find %s -type f \\( -name '*.sh' -o -name '*.list' -o -name '*.conf' -o -name '*.yaml' -o -name '*.yml' -o -name '*.json' \\) -exec sed -i 's|%s|%s|g' {} +", fmt.Sprintf("find %s -type f \\( -name '*.sh' -o -name '*.list' -o -name '*.conf' -o -name '*.yaml' -o -name '*.yml' -o -name '*.json' \\) -exec sed -i 's|%s|%s|g' {} +",
dir, old, dir)).Run() dir, old, dir)).Run()
// Unique internal ports per instance // Unique internal ports + wcli config-file per instance
offset := hashPort(filepath.Base(filepath.Dir(dir))) offset := hashPort(filepath.Base(filepath.Dir(dir)))
exec.Command("bash", "-c", exec.Command("bash", "-c",
fmt.Sprintf("find %s -type f \\( -name '*.yaml' -o -name '*.yml' -o -name '*.conf' \\) -exec sed -i 's|:3313|:%d|g; s|:6388|:%d|g; s|:9001|:%d|g; s|:8088|:%d|g; s|:9667|:%d|g' {} +", fmt.Sprintf("find %s -type f \\( -name '*.yaml' -o -name '*.yml' -o -name '*.conf' \\) -exec sed -i 's|:3313|:%d|g; s|:6388|:%d|g; s|:9001|:%d|g; s|:8088|:%d|g; s|:9667|:%d|g' {} + ; "+
dir, 3313+offset, 6388+offset, 9001+offset, 8088+offset, 9667+offset)).Run() "find %s -name '*.conf' -exec sed -i 's|\\(wcli run\\)$|\\1 --config-file %s/etc/wallarm/node.yaml|' {} +",
dir, 3313+offset, 6388+offset, 9001+offset, 8088+offset, 9667+offset,
dir, dir)).Run()
} }
func hashPort(s string) int { func hashPort(s string) int {