File tree 2 files changed +11
-4
lines changed 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,9 @@ def test_configmap_apis(self):
443
443
"apiVersion" : "v1" ,
444
444
"metadata" : {
445
445
"name" : name ,
446
+ "labels" : {
447
+ "e2e-test" : "true" ,
448
+ },
446
449
},
447
450
"data" : {
448
451
"config.json" : "{\" command\" :\" /usr/bin/mysqld_safe\" }" ,
@@ -466,7 +469,7 @@ def test_configmap_apis(self):
466
469
resp = api .delete_namespaced_config_map (
467
470
name = name , body = {}, namespace = 'default' )
468
471
469
- resp = api .list_namespaced_config_map ('default' , pretty = True )
472
+ resp = api .list_namespaced_config_map ('default' , pretty = True , label_selector = "e2e-test=true" )
470
473
self .assertEqual ([], resp .items )
471
474
472
475
def test_node_apis (self ):
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ def config_map_with_value(name, value):
32
32
"kind" : "ConfigMap" ,
33
33
"metadata" : {
34
34
"name" : name ,
35
+ "labels" : {
36
+ "e2e-test" : "true" ,
37
+ },
35
38
},
36
39
"data" : {
37
40
"key" : value ,
@@ -57,7 +60,7 @@ def test_watch_configmaps(self):
57
60
body = configmap_a , namespace = 'default' )
58
61
59
62
# list all configmaps and extract the resource version
60
- resp = api .list_namespaced_config_map ('default' )
63
+ resp = api .list_namespaced_config_map ('default' , label_selector = "e2e-test=true" )
61
64
rv = resp .metadata .resource_version
62
65
63
66
# create another configmap
@@ -73,7 +76,7 @@ def test_watch_configmaps(self):
73
76
74
77
# delete all configmaps
75
78
api .delete_collection_namespaced_config_map (
76
- namespace = 'default' )
79
+ namespace = 'default' , label_selector = "e2e-test=true" )
77
80
78
81
w = watch .Watch ()
79
82
# expect to observe all events happened after the initial LIST
@@ -83,7 +86,8 @@ def test_watch_configmaps(self):
83
86
for event in w .stream (api .list_namespaced_config_map ,
84
87
namespace = 'default' ,
85
88
resource_version = rv ,
86
- timeout_seconds = 5 ):
89
+ timeout_seconds = 5 ,
90
+ label_selector = "e2e-test=true" ):
87
91
self .assertEqual (event ['type' ], expect [i ])
88
92
# Kubernetes doesn't guarantee the order of the two objects
89
93
# being deleted
You can’t perform that action at this time.
0 commit comments