Skip to content

Commit

Permalink
fixup: Update guestIPMustBeZero error message
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Dubois <[email protected]>
Signed-off-by: Victor Gama <[email protected]>
  • Loading branch information
heyvito and jandubois committed May 18, 2023
1 parent d010add commit 33d7e73
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/limayaml/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ func Validate(y LimaYAML, warn bool) error {
for i, rule := range y.PortForwards {
field := fmt.Sprintf("portForwards[%d]", i)
if rule.GuestIPMustBeZero && !rule.GuestIP.Equal(net.IPv4zero) && !rule.GuestIP.Equal(net.IPv6zero) {
// Using IPv6 first so go vet doesn't complain about the error
// message ending with a colon.
return fmt.Errorf("field `%s.guestIPMustBeZero` can only be true when field `%s.guestIP` is either :: or 0.0.0.0", field, field)
return fmt.Errorf("field `%s.guestIPMustBeZero` can only be true when field `%s.guestIP` is either `0.0.0.0` or `::`", field, field)
}
if rule.GuestPort != 0 {
if rule.GuestSocket != "" {
Expand Down

0 comments on commit 33d7e73

Please sign in to comment.