@@ -99,9 +99,6 @@ def analyze_livesim(policy_finder):
99
99
"""
100
100
livesim_configuration_addons = []
101
101
102
- # stop collecting messages when pre-processing and analyzing livesim yaml files.
103
- NcaLogger ().dont_collect_msgs ()
104
-
105
102
# find kube-dns reference
106
103
dns_added_resources = ResourcesHandler .get_relevant_livesim_resources_paths_by_labels_matching (
107
104
LiveSimPaths .DnsCfgPath , policy_finder .missing_dns_pods_with_labels )
@@ -122,7 +119,6 @@ def analyze_livesim(policy_finder):
122
119
livesim_configuration_addons += istio_gateway_added_resources
123
120
ResourcesHandler .livesim_information_message ('Istio-ingress-gateway' )
124
121
125
- NcaLogger ().collect_msgs ()
126
122
return livesim_configuration_addons
127
123
128
124
def parse_elements (self , ns_list , pod_list , resource_list , config_name , save_flag , np_list ):
@@ -171,9 +167,9 @@ def get_network_config(self, np_list, ns_list, pod_list, resource_list, config_n
171
167
save_flag ,
172
168
np_list
173
169
)
170
+ NcaLogger ().unmute ()
174
171
# check if LiveSim can add anything.
175
172
livesim_addons = self .analyze_livesim (resources_parser .policies_finder )
176
- NcaLogger ().unmute ()
177
173
if livesim_addons :
178
174
NcaLogger ().flush_messages (silent = True )
179
175
if ns_list :
@@ -364,6 +360,8 @@ def parse_livesim_yamls(path):
364
360
yaml_files = resource_scanner .get_yamls ()
365
361
366
362
results = {}
363
+ # stop collecting messages when pre-processing and analyzing livesim yaml files.
364
+ NcaLogger ().dont_collect_msgs ()
367
365
for yaml_file in yaml_files :
368
366
pods_finder = PodsFinder ()
369
367
ns_finder = NamespacesFinder ()
@@ -377,6 +375,7 @@ def parse_livesim_yamls(path):
377
375
for item in pods_finder .peer_set :
378
376
labels_found .update (item .labels )
379
377
results .update ({yaml_file .path : labels_found })
378
+ NcaLogger ().collect_msgs ()
380
379
381
380
return results
382
381
0 commit comments