1
1
/*
2
- Copyright 2018 The Kubernetes Authors.
2
+ Copyright 2018 The Kubernetes Authors.
3
3
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
7
8
- http://www.apache.org/licenses/LICENSE-2.0
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
9
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
15
*/
16
16
17
17
package handler_test
@@ -27,6 +27,7 @@ import (
27
27
"k8s.io/apimachinery/pkg/types"
28
28
"k8s.io/client-go/kubernetes/scheme"
29
29
"k8s.io/client-go/util/workqueue"
30
+ "sigs.k8s.io/controller-runtime/pkg/client"
30
31
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
31
32
"sigs.k8s.io/controller-runtime/pkg/controller/controllertest"
32
33
"sigs.k8s.io/controller-runtime/pkg/event"
@@ -191,9 +192,9 @@ var _ = Describe("Eventhandler", func() {
191
192
Describe ("EnqueueRequestsFromMapFunc" , func () {
192
193
It ("should enqueue a Request with the function applied to the CreateEvent." , func () {
193
194
req := []reconcile.Request {}
194
- instance := handler .EnqueueRequestsFromMapFunc (func (a handler. MapObject ) []reconcile.Request {
195
+ instance := handler .EnqueueRequestsFromMapFunc (func (a client. Object ) []reconcile.Request {
195
196
defer GinkgoRecover ()
196
- Expect (a . Object ).To (Equal (pod ))
197
+ Expect (a ).To (Equal (pod ))
197
198
req = []reconcile.Request {
198
199
{
199
200
NamespacedName : types.NamespacedName {Namespace : "foo" , Name : "bar" },
@@ -222,9 +223,9 @@ var _ = Describe("Eventhandler", func() {
222
223
223
224
It ("should enqueue a Request with the function applied to the DeleteEvent." , func () {
224
225
req := []reconcile.Request {}
225
- instance := handler .EnqueueRequestsFromMapFunc (func (a handler. MapObject ) []reconcile.Request {
226
+ instance := handler .EnqueueRequestsFromMapFunc (func (a client. Object ) []reconcile.Request {
226
227
defer GinkgoRecover ()
227
- Expect (a . Object ).To (Equal (pod ))
228
+ Expect (a ).To (Equal (pod ))
228
229
req = []reconcile.Request {
229
230
{
230
231
NamespacedName : types.NamespacedName {Namespace : "foo" , Name : "bar" },
@@ -259,14 +260,14 @@ var _ = Describe("Eventhandler", func() {
259
260
260
261
req := []reconcile.Request {}
261
262
262
- instance := handler .EnqueueRequestsFromMapFunc (func (a handler. MapObject ) []reconcile.Request {
263
+ instance := handler .EnqueueRequestsFromMapFunc (func (a client. Object ) []reconcile.Request {
263
264
defer GinkgoRecover ()
264
265
req = []reconcile.Request {
265
266
{
266
- NamespacedName : types.NamespacedName {Namespace : "foo" , Name : a .Object . GetName () + "-bar" },
267
+ NamespacedName : types.NamespacedName {Namespace : "foo" , Name : a .GetName () + "-bar" },
267
268
},
268
269
{
269
- NamespacedName : types.NamespacedName {Namespace : "biz" , Name : a .Object . GetName () + "-baz" },
270
+ NamespacedName : types.NamespacedName {Namespace : "biz" , Name : a .GetName () + "-baz" },
270
271
},
271
272
}
272
273
return req
@@ -298,9 +299,9 @@ var _ = Describe("Eventhandler", func() {
298
299
299
300
It ("should enqueue a Request with the function applied to the GenericEvent." , func () {
300
301
req := []reconcile.Request {}
301
- instance := handler .EnqueueRequestsFromMapFunc (func (a handler. MapObject ) []reconcile.Request {
302
+ instance := handler .EnqueueRequestsFromMapFunc (func (a client. Object ) []reconcile.Request {
302
303
defer GinkgoRecover ()
303
- Expect (a . Object ).To (Equal (pod ))
304
+ Expect (a ).To (Equal (pod ))
304
305
req = []reconcile.Request {
305
306
{
306
307
NamespacedName : types.NamespacedName {Namespace : "foo" , Name : "bar" },
0 commit comments