diff --git a/krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py b/krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py index 0ba97d2a..6e626a40 100644 --- a/krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py +++ b/krkn/scenario_plugins/time_actions/time_actions_scenario_plugin.py @@ -144,6 +144,10 @@ class TimeActionsScenarioPlugin(AbstractScenarioPlugin): node_names = scenario["object_name"] elif "label_selector" in scenario.keys() and scenario["label_selector"]: node_names = kubecli.list_nodes(scenario["label_selector"]) + # going to filter out nodes with the exclude_label if it is provided + if "exclude_label" in scenario.keys() and scenario["exclude_label"]: + excluded_nodes = kubleci.list_nodes(scenario["exclude_label"]) + node_names = [node for node in node_names if node not in excluded_nodes] for node in node_names: self.skew_node(node, scenario["action"], kubecli) logging.info("Reset date/time on node " + str(node)) @@ -189,6 +193,10 @@ class TimeActionsScenarioPlugin(AbstractScenarioPlugin): counter += 1 elif "label_selector" in scenario.keys() and scenario["label_selector"]: pod_names = kubecli.get_all_pods(scenario["label_selector"]) + # and here filter out the pods with exclude_label if it is provided + if "exclude_label" in scenario.keys() and scenario["exclude_label"]: + excluded_pods = kubleci.get_all_pods(scenario["exclude_label"]) + pod_names = [pod for pod in pod_names if pod not in excluded_pods] if len(pod_names) == 0: logging.info(