Add pod delete control

- Push shortcut reports when pods are created/deleted
- Buffer upto 2 reports instead of dropping them
This commit is contained in:
Tom Wilkie
2016-04-21 17:34:08 +01:00
parent 64450a4830
commit cb52acbc46
12 changed files with 232 additions and 39 deletions

View File

@@ -175,6 +175,15 @@ func ParsePodNodeID(podNodeID string) (namespaceID, podID string, ok bool) {
return fields[0], fields[1], true
}
// ParseServiceNodeID produces the namespace ID and service ID from an service node ID.
func ParseServiceNodeID(serviceNodeID string) (namespaceID, serviceID string, ok bool) {
fields := strings.SplitN(serviceNodeID, ScopeDelim, 2)
if len(fields) != 2 {
return "", "", false
}
return fields[0], fields[1], true
}
// ExtractHostID extracts the host id from Node
func ExtractHostID(m Node) string {
hostNodeID, _ := m.Latest.Lookup(HostNodeID)