Merge pull request #50008 from atlassian/meta-controller-ref

Automatic merge from submit-queue

Migrate to controller references helpers in meta/v1

**What this PR does / why we need it**:
This is a follow up for #48319 that migrates all method usages to new methods in meta/v1.

**Special notes for your reviewer**:
Looking at each commit individually might be easier.

**Release note**:
```release-note
NONE
```
/sig api-machinery
/kind cleanup
This commit is contained in:
Kubernetes Submit Queue
2017-08-10 17:07:30 -07:00
committed by GitHub
38 changed files with 93 additions and 212 deletions

View File

@@ -201,7 +201,7 @@ func newPod(podName string, nodeName string, label map[string]string, ds *extens
}
pod.Name = names.SimpleNameGenerator.GenerateName(podName)
if ds != nil {
pod.OwnerReferences = []metav1.OwnerReference{*newControllerRef(ds)}
pod.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(ds, controllerKind)}
}
return pod
}
@@ -1806,7 +1806,7 @@ func TestUpdatePodChangeControllerRef(t *testing.T) {
pod := newPod("pod1-", "node-0", simpleDaemonSetLabel, ds1)
prev := *pod
prev.OwnerReferences = []metav1.OwnerReference{*newControllerRef(ds2)}
prev.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(ds2, controllerKind)}
bumpResourceVersion(pod)
manager.updatePod(&prev, pod)
if got, want := manager.queue.Len(), 2; got != want {