Skip to content

Commit

Permalink
target.Location must always be set
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Jun 30, 2023
1 parent bc85a35 commit 8901224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internals/plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ func CombineLayers(layers ...*Layer) (*Layer, error) {
}
}

if target.Location == "" && len(target.Services) > 0 {
if target.Location == "" {
return nil, &FormatError{
Message: fmt.Sprintf(`plan must define "location" for log target %q`, name),
}
Expand Down
3 changes: 3 additions & 0 deletions internals/plan/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ var planTests = []planTest{{
override: merge
tgt2:
type: syslog
location: udp://1.2.3.4:514
services: []
override: replace
tgt3:
Expand Down Expand Up @@ -1007,6 +1008,7 @@ var planTests = []planTest{{
"tgt2": {
Name: "tgt2",
Type: plan.SyslogTarget,
Location: "udp://1.2.3.4:514",
Services: []string{},
Override: plan.ReplaceOverride,
},
Expand Down Expand Up @@ -1052,6 +1054,7 @@ var planTests = []planTest{{
"tgt2": {
Name: "tgt2",
Type: plan.SyslogTarget,
Location: "udp://1.2.3.4:514",
Override: plan.ReplaceOverride,
},
"tgt3": {
Expand Down

0 comments on commit 8901224

Please sign in to comment.