5757COMPONENT_STATUS_FAILED_NODES = "failedComponents"
5858COMPONENT_STATUS_DEPLOYED_COUNT = "deployed"
5959COMPONENT_STATUS_VERIFIED_COUNT = "verified"
60+ COMPONENT_STATUS_DEPENDENCY_GRAPH = "dependencyGraph"
6061
6162# The fields in status that hold the version information
6263# NOTE: These intentionally match IBM CloudPak naming conventions
@@ -134,6 +135,7 @@ def make_application_status( # pylint: disable=too-many-arguments,too-many-loca
134135 supported_versions : Optional [List [str ]] = None ,
135136 operator_version : Optional [str ] = None ,
136137 kind : Optional [str ] = None ,
138+ dependency_graph : Optional [str ] = None ,
137139) -> dict :
138140 """Create a full status object for an application
139141
@@ -163,6 +165,8 @@ def make_application_status( # pylint: disable=too-many-arguments,too-many-loca
163165 The kind of reconciling CR. If specified, this function adds
164166 service status field which is compliant with IBM Cloud Pak
165167 requirements.
168+ dependency_graph: Optional[str]
169+ String representation of the session dependency graph
166170
167171 Returns:
168172 current_status: dict
@@ -184,7 +188,9 @@ def make_application_status( # pylint: disable=too-many-arguments,too-many-loca
184188 # track which components have deployed and verified
185189 if component_state is not None :
186190 log .debug2 ("Adding component state to status" )
187- status [COMPONENT_STATUS ] = _make_component_state (component_state )
191+ status [COMPONENT_STATUS ] = _make_component_state (
192+ component_state , dependency_graph
193+ )
188194 log .debug3 (status [COMPONENT_STATUS ])
189195
190196 # Create the versions section
@@ -491,7 +497,9 @@ def _make_updating_condition(
491497 )
492498
493499
494- def _make_component_state (component_state : CompletionState ) -> dict :
500+ def _make_component_state (
501+ component_state : CompletionState , dependency_graph : Optional [str ] = None
502+ ) -> dict :
495503 """Make the component state object"""
496504 all_nodes = sorted ([comp .get_name () for comp in component_state .all_nodes ])
497505 deployed_nodes = sorted (
@@ -509,7 +517,7 @@ def _make_component_state(component_state: CompletionState) -> dict:
509517 [comp .get_name () for comp in component_state .unverified_nodes ]
510518 )
511519 failed_nodes = sorted ([comp .get_name () for comp in component_state .failed_nodes ])
512- return {
520+ result = {
513521 COMPONENT_STATUS_ALL_NODES : all_nodes ,
514522 COMPONENT_STATUS_DEPLOYED_NODES : deployed_nodes ,
515523 COMPONENT_STATUS_UNVERIFIED_NODES : unverified_nodes ,
@@ -518,6 +526,12 @@ def _make_component_state(component_state: CompletionState) -> dict:
518526 COMPONENT_STATUS_VERIFIED_COUNT : f"{ len (verified_nodes )} /{ len (all_nodes )} " ,
519527 }
520528
529+ # Add dependency graph if provided
530+ if dependency_graph is not None :
531+ result [COMPONENT_STATUS_DEPENDENCY_GRAPH ] = dependency_graph
532+
533+ return result
534+
521535
522536def _make_available_version (version : str ) -> dict :
523537 """Make an object for the available version list following the IBM CloudPak
0 commit comments