mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
Merge pull request #3762 from jwhonce/issue/3426
Improve dns-search validation, empty domains now return an error
This commit is contained in:
commit
4b91f60e89
|
@ -627,6 +627,11 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
|
|||
return nil, errors.Errorf("cannot pass additional search domains when also specifying '.'")
|
||||
}
|
||||
|
||||
// Check for explicit dns-search domain of ''
|
||||
if c.Changed("dns-search") && len(c.StringSlice("dns-search")) == 0 {
|
||||
return nil, errors.Errorf("'' is not a valid domain")
|
||||
}
|
||||
|
||||
// Validate domains are good
|
||||
for _, dom := range c.StringSlice("dns-search") {
|
||||
if dom == "." {
|
||||
|
|
Loading…
Reference in a new issue