Merge pull request #3762 from jwhonce/issue/3426

Improve dns-search validation, empty domains now return an error
This commit is contained in:
OpenShift Merge Robot 2019-08-09 20:09:12 +02:00 committed by GitHub
commit 4b91f60e89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 == "." {