tests: CoreDNSServerAndPorts (#972)
* tests: CoreDNSServerAndPorts Copy from kubernetes.go and renamed to fit the style, adapted almost all callers. This is a mechanicl change, no testdata was changed. * typos
This commit is contained in:
parent
ea53f8c219
commit
f901b0cefa
24 changed files with 39 additions and 143 deletions
|
@ -48,6 +48,17 @@ func CoreDNSServerPorts(i *caddy.Instance, k int) (udp, tcp string) {
|
|||
return
|
||||
}
|
||||
|
||||
// CoreDNSServerAndPorts combines CoreDNSServer and CoreDNSServerPorts to start a CoreDNS
|
||||
// server and returns the udp and tcp ports of the first instance.
|
||||
func CoreDNSServerAndPorts(corefile string) (i *caddy.Instance, udp, tcp string, err error) {
|
||||
i, err = CoreDNSServer(corefile)
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
udp, tcp = CoreDNSServerPorts(i, 0)
|
||||
return i, udp, tcp, nil
|
||||
}
|
||||
|
||||
// Input implements the caddy.Input interface and acts as an easy way to use a string as a Corefile.
|
||||
type Input struct {
|
||||
corefile []byte
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue