wip: the if check was not correct

This commit is contained in:
Laurence 2024-04-23 13:03:55 +01:00
parent 61e591081d
commit 8e20b9dce6
No known key found for this signature in database
GPG key ID: B053BEE3478E8FEF

View file

@ -91,7 +91,7 @@ func (d *DockerSource) UnmarshalConfig(yamlConfig []byte) error {
return fmt.Errorf("no containers names or containers ID configuration provided")
}
if d.Config.UseContainerLabels && len(d.Config.ContainerName) > 0 && len(d.Config.ContainerID) > 0 && len(d.Config.ContainerIDRegexp) > 0 && len(d.Config.ContainerNameRegexp) > 0 {
if d.Config.UseContainerLabels && len(d.Config.ContainerName) > 0 || len(d.Config.ContainerID) > 0 || len(d.Config.ContainerIDRegexp) > 0 || len(d.Config.ContainerNameRegexp) > 0 {
return fmt.Errorf("use_container_labels and container_name, container_id, container_id_regexp, container_name_regexp are mutually exclusive")
}