From e3d25b1bddab24ede5a5814fb46cd4b2cee8e327 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Tue, 31 Jan 2023 15:53:48 +0100 Subject: [PATCH] Add check for duplicate filesystem names --- config/config.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/config.go b/config/config.go index 256f5022..28db978f 100644 --- a/config/config.go +++ b/config/config.go @@ -380,6 +380,21 @@ func (d *Config) Validate(resetLogs bool) { } } + if len(d.Storage.S3) != 0 { + names := map[string]struct{}{ + "disk": {}, + "mem": {}, + } + + for _, s3 := range d.Storage.S3 { + if _, ok := names[s3.Name]; ok { + d.vars.Log("error", "storage.s3", "the name %s is already in use or reserved", s3.Name) + } + + names[s3.Name] = struct{}{} + } + } + // If playout is enabled, check that the port range is sane if d.Playout.Enable { if d.Playout.MinPort >= d.Playout.MaxPort {