@@ -54,7 +54,7 @@ void testInformPodWithLabel() throws InterruptedException {
54
54
.withResourceVersion ("1" ).endMetadata ().build ();
55
55
56
56
server .expect ()
57
- .withPath ("/api/v1/namespaces/test/pods?labelSelector=my-label" )
57
+ .withPath ("/api/v1/namespaces/test/pods?watch=false& labelSelector=my-label" )
58
58
.andReturn (HttpURLConnection .HTTP_OK ,
59
59
new PodListBuilder ().withNewMetadata ().withResourceVersion ("1" ).endMetadata ().withItems (pod1 ).build ())
60
60
.once ();
@@ -108,7 +108,7 @@ void testInformGeneric() throws InterruptedException {
108
108
list .setItems (Arrays .asList (dummy ));
109
109
110
110
server .expect ()
111
- .withPath ("/apis/demos.fabric8.io/v1/namespaces/test/dummies?labelSelector=my-label" )
111
+ .withPath ("/apis/demos.fabric8.io/v1/namespaces/test/dummies?watch=false& labelSelector=my-label" )
112
112
.andReturn (HttpURLConnection .HTTP_OK , list )
113
113
.once ();
114
114
@@ -151,7 +151,7 @@ public void onUpdate(GenericKubernetesResource oldObj, GenericKubernetesResource
151
151
.build ();
152
152
153
153
SharedIndexInformer <GenericKubernetesResource > informer =
154
- client .genericCustomResources (context ).withLabel ("my-label" ).inform (handler );
154
+ client .genericKubernetesResources (context ).withLabel ("my-label" ).inform (handler );
155
155
156
156
assertTrue (deleteLatch .await (10 , TimeUnit .SECONDS ));
157
157
assertTrue (addLatch .await (10 , TimeUnit .SECONDS ));
@@ -169,13 +169,13 @@ void testGenericWithKnownType() throws InterruptedException {
169
169
.withResourceVersion ("1" ).endMetadata ().build ();
170
170
171
171
server .expect ()
172
- .withPath ("/apis/demos.fabric8.io/ v1/namespaces/test/dummies?labelSelector=my-label " )
172
+ .withPath ("/api/ v1/namespaces/test/pods?watch=false&fieldSelector=metadata.name%3Dpod1 " )
173
173
.andReturn (HttpURLConnection .HTTP_OK ,
174
174
new PodListBuilder ().withNewMetadata ().withResourceVersion ("1" ).endMetadata ().withItems (pod1 ).build ())
175
175
.once ();
176
176
177
177
server .expect ()
178
- .withPath ("/apis/demos.fabric8.io/ v1/namespaces/test/dummies?labelSelector=my-label &resourceVersion=1&watch=true" )
178
+ .withPath ("/api/ v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1%2Cmetadata.name%3Dpod1 &resourceVersion=1&watch=true" )
179
179
.andUpgradeToWebSocket ()
180
180
.open ()
181
181
.waitFor (EVENT_WAIT_PERIOD_MS )
@@ -206,15 +206,14 @@ public void onUpdate(GenericKubernetesResource oldObj, GenericKubernetesResource
206
206
207
207
// When
208
208
CustomResourceDefinitionContext context = new CustomResourceDefinitionContext .Builder ()
209
- .withKind ("Dummy " )
209
+ .withKind ("Pod " )
210
210
.withScope ("Namespaced" )
211
211
.withVersion ("v1" )
212
- .withGroup ("demos.fabric8.io" )
213
- .withPlural ("dummies" )
212
+ .withPlural ("pods" )
214
213
.build ();
215
214
216
215
SharedIndexInformer <GenericKubernetesResource > informer =
217
- client .genericCustomResources (context ).withLabel ( "my-label " ).inform (handler );
216
+ client .genericKubernetesResources (context ).withName ( "pod1 " ).inform (handler );
218
217
219
218
assertTrue (deleteLatch .await (1000 , TimeUnit .SECONDS ));
220
219
assertTrue (addLatch .await (1000 , TimeUnit .SECONDS ));
0 commit comments