Skip to content

Commit b2de359

Browse files
committed
Revert "feat: show dependency graph in status filed only with log level4."
This reverts commit 0122031. Signed-off-by: Yuki Ito <yuki462@ibm.com>
1 parent 0122031 commit b2de359

File tree

2 files changed

+1
-67
lines changed

2 files changed

+1
-67
lines changed

oper8/reconcile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,11 +1087,9 @@ def _update_reconcile_completion_status(
10871087
"""
10881088
status_update = {
10891089
"component_state": completion_state,
1090+
"dependency_graph": str(session.graph),
10901091
}
10911092

1092-
if log.isEnabled("debug4"):
1093-
status_update["dependency_graph"] = str(session.graph)
1094-
10951093
# If everything completed and verified, set ready and updating to STABLE
10961094
# and set the status's reconciled version to the desired version
10971095
if completion_state.verify_completed():

tests/test_reconcile.py

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,70 +1301,6 @@ def test_update_reconcile_completion_status(
13011301
check_status(dm, cr, ready_reason, updating_reason, completion_state)
13021302

13031303

1304-
@pytest.mark.parametrize(
1305-
["log_level", "should_include_graph"],
1306-
[
1307-
["debug4", True],
1308-
["debug3", False],
1309-
["debug2", False],
1310-
["debug", False],
1311-
["info", False],
1312-
],
1313-
)
1314-
def test_update_reconcile_completion_status_dependency_graph_by_log_level(
1315-
log_level, should_include_graph
1316-
):
1317-
"""Test that dependency_graph is only included in status when log level is debug4"""
1318-
# Local
1319-
from oper8.dag import Graph
1320-
1321-
# Setup CR with log level annotation
1322-
cr = setup_cr()
1323-
cr["metadata"]["annotations"] = {
1324-
constants.LOG_DEFAULT_LEVEL_NAME: log_level,
1325-
}
1326-
1327-
# Create a graph with nodes
1328-
graph = Graph()
1329-
node_a = Node("A")
1330-
node_b = Node("B")
1331-
graph.add_node(node_a)
1332-
graph.add_node(node_b)
1333-
graph.add_node_dependency(node_a, node_b)
1334-
1335-
completion_state = CompletionState(verified_nodes=[node_a, node_b])
1336-
1337-
dm = MockDeployManager(resources=[cr])
1338-
rm = ReconcileManager(deploy_manager=dm)
1339-
session = setup_session(full_cr=cr, deploy_manager=dm)
1340-
# Access the private __graph attribute
1341-
session._Session__graph = graph
1342-
1343-
# Configure logging with the specified level
1344-
alog.configure(default_level=log_level)
1345-
1346-
rm._update_reconcile_completion_status(session, completion_state)
1347-
1348-
# Check the status
1349-
obj = dm.get_obj(
1350-
kind=cr.kind,
1351-
name=cr.metadata.name,
1352-
namespace=cr.metadata.namespace,
1353-
api_version=cr.apiVersion,
1354-
)
1355-
assert obj is not None
1356-
assert obj.get("status")
1357-
1358-
component_status = obj["status"].get(status.COMPONENT_STATUS)
1359-
assert component_status is not None
1360-
1361-
if should_include_graph:
1362-
assert status.COMPONENT_STATUS_DEPENDENCY_GRAPH in component_status
1363-
assert component_status[status.COMPONENT_STATUS_DEPENDENCY_GRAPH] == str(graph)
1364-
else:
1365-
assert status.COMPONENT_STATUS_DEPENDENCY_GRAPH not in component_status
1366-
1367-
13681304
###############
13691305
## _update_error_status ##
13701306
###############

0 commit comments

Comments
 (0)