mw/kubernetes: remove kService and kPod

Remove the intermediate step of gathering everyhing in a kPod and
kService and extracting the msg.Service from there. Now findPods and
findServices return []msg.Service.

This cuts down on the code and also removed the double looping of
finding the data we need, so it should be faster.
This commit is contained in:
Miek Gieben
2017-08-22 07:53:11 +01:00
parent 0191ec74d8
commit aacb91ef0b
6 changed files with 95 additions and 148 deletions

View File

@@ -26,7 +26,7 @@ type recordRequest struct {
// parseRequest parses the qname to find all the elements we need for querying k8s. Anything
// that is not parsed will have the wildcard "*" value (except r.endpoint).
// Potential underscores are stripped from _port and _protocol.
func (k *Kubernetes) parseRequest(state request.Request) (r recordRequest, err error) {
func parseRequest(state request.Request) (r recordRequest, err error) {
// 3 Possible cases:
// 1. _port._protocol.service.namespace.pod|svc.zone
// 2. (endpoint): endpoint.service.namespace.pod|svc.zone