mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-28 00:37:39 +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
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue