ValidateUrl will validate url flag correctness. It can be either from --url or argument Notice ValidateUnixSocket, it will enforce --unix-socket is not used with --url or argument
(c *cli.Context, allowURLFromArgs bool)
| 163 | // ValidateUrl will validate url flag correctness. It can be either from --url or argument |
| 164 | // Notice ValidateUnixSocket, it will enforce --unix-socket is not used with --url or argument |
| 165 | func ValidateUrl(c *cli.Context, allowURLFromArgs bool) (*url.URL, error) { |
| 166 | var url = c.String("url") |
| 167 | if allowURLFromArgs && c.NArg() > 0 { |
| 168 | if c.IsSet("url") { |
| 169 | return nil, errors.New("Specified origin urls using both --url and argument. Decide which one you want, I can only support one.") |
| 170 | } |
| 171 | url = c.Args().Get(0) |
| 172 | } |
| 173 | validUrl, err := validation.ValidateUrl(url) |
| 174 | return validUrl, err |
| 175 | } |
| 176 | |
| 177 | type UnvalidatedIngressRule struct { |
| 178 | Hostname string `json:"hostname,omitempty"` |
no test coverage detected