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