diff --git a/pkg/controller/controllerutil/controllerutil_test.go b/pkg/controller/controllerutil/controllerutil_test.go index 8544abce46..b556f29dba 100644 --- a/pkg/controller/controllerutil/controllerutil_test.go +++ b/pkg/controller/controllerutil/controllerutil_test.go @@ -967,8 +967,7 @@ var _ = Describe("Controllerutil", func() { ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "foo-uid"}, } Expect(controllerutil.SetOwnerReference(dep, rs, scheme.Scheme)).ToNot(HaveOccurred()) - - b, err := controllerutil.HasOwnerReference(dep.GetOwnerReferences(), rs, scheme.Scheme) + b, err := controllerutil.HasOwnerReference(rs.GetOwnerReferences(), dep, scheme.Scheme) Expect(err).NotTo(HaveOccurred()) Expect(b).To(BeTrue()) }) @@ -980,15 +979,15 @@ var _ = Describe("Controllerutil", func() { dep := &extensionsv1beta1.Deployment{ ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "foo-uid"}, } - b, err := controllerutil.HasOwnerReference(dep.GetOwnerReferences(), rs, scheme.Scheme) + b, err := controllerutil.HasOwnerReference(rs.GetOwnerReferences(), dep, scheme.Scheme) Expect(err).NotTo(HaveOccurred()) Expect(b).To(BeFalse()) }) It("should return error if the object can not create group-version-kind", func() { rs := &appsv1.ReplicaSet{} - dep := &errMetaObj{} - b, err := controllerutil.HasOwnerReference(dep.GetOwnerReferences(), rs, runtime.NewScheme()) + dep := &extensionsv1beta1.Deployment{} + b, err := controllerutil.HasOwnerReference(rs.GetOwnerReferences(), dep, scheme.Scheme) Expect(err).To(HaveOccurred()) Expect(b).To(BeFalse()) })