Change podNamespacer API

This commit is contained in:
Wojciech Tyczynski
2016-08-17 16:16:01 +02:00
parent c0e79d8da7
commit 331083727f
13 changed files with 73 additions and 58 deletions

View File

@@ -53,13 +53,13 @@ func NewPodControllerRefManager(
// controllerRef pointing to other object are ignored) 3. controlledDoesNotMatch
// are the pods that have a controllerRef pointing to the controller, but their
// labels no longer match the selector.
func (m *PodControllerRefManager) Classify(pods []api.Pod) (
func (m *PodControllerRefManager) Classify(pods []*api.Pod) (
matchesAndControlled []*api.Pod,
matchesNeedsController []*api.Pod,
controlledDoesNotMatch []*api.Pod) {
for i := range pods {
pod := pods[i]
if !IsPodActive(pod) {
if !IsPodActive(*pod) {
glog.V(4).Infof("Ignoring inactive pod %v/%v in state %v, deletion time %v",
pod.Namespace, pod.Name, pod.Status.Phase, pod.DeletionTimestamp)
continue
@@ -69,9 +69,9 @@ func (m *PodControllerRefManager) Classify(pods []api.Pod) (
if controllerRef.UID == m.controllerObject.UID {
// already controlled
if m.controllerSelector.Matches(labels.Set(pod.Labels)) {
matchesAndControlled = append(matchesAndControlled, &pod)
matchesAndControlled = append(matchesAndControlled, pod)
} else {
controlledDoesNotMatch = append(controlledDoesNotMatch, &pod)
controlledDoesNotMatch = append(controlledDoesNotMatch, pod)
}
} else {
// ignoring the pod controlled by other controller
@@ -83,7 +83,7 @@ func (m *PodControllerRefManager) Classify(pods []api.Pod) (
if !m.controllerSelector.Matches(labels.Set(pod.Labels)) {
continue
}
matchesNeedsController = append(matchesNeedsController, &pod)
matchesNeedsController = append(matchesNeedsController, pod)
}
}
return matchesAndControlled, matchesNeedsController, controlledDoesNotMatch