Documentation ¶
Index ¶
- Constants
- func CoreDNSPodIPs() ([]string, error)
- func CorednsLogs() string
- func DoIntegrationTest(tc test.Case, namespace string) (*dns.Msg, error)
- func DoIntegrationTests(t *testing.T, testCases []test.Case, namespace string)
- func FetchDockerContainerID(containerName string) (string, error)
- func HasResourceRestarted(label string) (bool, error)
- func Kubectl(args string) (result string, err error)
- func LoadCorefile(corefile string) error
- func LoadCorefileAndZonefile(corefile, zonefile string, restart bool) error
- func LoadKubednsConfigmap(stubdata, upstreamdata string) error
- func ParseDigAXFR(s *bufio.Scanner) (*dns.Msg, error)
- func ParseDigResponse(r string, dp DigParser) ([]*dns.Msg, error)
- func ScrapeMetrics(t *testing.T) []byte
- func StartClientPod(namespace string) error
- func UpstreamServer(t *testing.T, zone, zoneFile string) (func(), *caddy.Instance, string)
- func ValidateAXFR(xfr []dns.RR, expected []dns.RR) []error
- func WaitForClientPodRecord(namespace string) error
- func WaitNReady(maxWait, n int) error
- func WaitReady(maxWait int) error
- type DigParser
Constants ¶
const ( // KubednsConfigmap is the header used for defining the kube-dns configmap KubednsConfigmap = `apiVersion: v1 kind: ConfigMap metadata: name: kube-dns namespace: kube-system data: ` // ExampleNet is an example upstream zone file ExampleNet = `` /* 178-byte string literal not displayed */ CoreDNSLabel = "k8s-app=kube-dns" APIServerLabel = "component=kube-apiserver" )
configmap is the header used for defining the coredns configmap
Variables ¶
This section is empty.
Functions ¶
func CoreDNSPodIPs ¶
CoreDNSPodIPs return the ips of all coredns pods
func DoIntegrationTest ¶
DoIntegrationTest executes a test case
func DoIntegrationTests ¶
DoIntegrationTests executes test cases
func FetchDockerContainerID ¶
FetchDockerContainerID fetches the docker container ID from the container name
func HasResourceRestarted ¶
HasResourceRestarted verifies if any of the specified containers in the kube-system namespace has restarted.
func LoadCorefile ¶
LoadCorefile calls loadCorefileAndZonefile without a zone file
func LoadCorefileAndZonefile ¶
LoadCorefileAndZonefile constructs a configmap defining files for the corefile and zone, If restart is true, restarts the coredns pod to load the new configmap, and waits for the coredns pod to be ready.
func LoadKubednsConfigmap ¶
func ParseDigAXFR ¶
ParseDigAXFR specifically parses AXFR responses which have a different format.
func ParseDigResponse ¶
ParseDigResponse parses dig-like command output and returns a dns.Msg
func ScrapeMetrics ¶
func StartClientPod ¶
StartClientPod starts a dns client pod in the namespace
func UpstreamServer ¶
UpstreamServer starts a local instance of coredns with the given zone file
func ValidateAXFR ¶
ValidateAXFR compares the dns records returned against a set of expected records. It ensures that the axfr response begins and ends with an SOA record. It will only test the first 3 tuples of each A record.
func WaitForClientPodRecord ¶
WaitForClientPodRecord waits for the client pod A record to be served by CoreDNS
func WaitNReady ¶
WaitReady waits for n corednses to be ready or times out after maxWait seconds with an error