From 6a523e2b8651956562f4a1fe76510b238df5577c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 1 Jul 2024 10:09:38 +0200 Subject: [PATCH] fix: mermaid diagrams for docsy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../en/docs/dependent-resources/_index.md | 5 ++--- docsy/content/en/docs/workflows/_index.md | 19 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docsy/content/en/docs/dependent-resources/_index.md b/docsy/content/en/docs/dependent-resources/_index.md index 1736c63c22..be67ec6ab6 100644 --- a/docsy/content/en/docs/dependent-resources/_index.md +++ b/docsy/content/en/docs/dependent-resources/_index.md @@ -14,7 +14,7 @@ the `Deployment` controller. Controllers that deal with secondary resources typically need to perform the following steps, for each secondary resource: -
+```mermaid flowchart TD compute[Compute desired secondary resource based on primary state] --> A @@ -25,8 +25,7 @@ A -- No --> Create --> Done match{Matches desired state?} match -- Yes --> Done match -- No --> Update --> Done - -
+``` While these steps are not difficult in and of themselves, there are some subtleties that can lead to bugs or sub-optimal code if not done right. As this process is pretty much similar for each diff --git a/docsy/content/en/docs/workflows/_index.md b/docsy/content/en/docs/workflows/_index.md index 4eba1f5d07..5f275c2b9a 100644 --- a/docsy/content/en/docs/workflows/_index.md +++ b/docsy/content/en/docs/workflows/_index.md @@ -230,15 +230,14 @@ Notation: The arrows depicts reconciliation ordering, thus following the reverse #### Reconcile Sample -
- +```mermaid stateDiagram-v2 1 --> 2 1 --> 3 2 --> 4 3 --> 4 +``` -
- Root nodes (i.e. nodes that don't depend on any others) are reconciled first. In this example, DR `1` is reconciled first since it doesn't depend on others. @@ -252,15 +251,15 @@ stateDiagram-v2 #### Sample with Reconcile Precondition -
- + +```mermaid stateDiagram-v2 1 --> 2 1 --> 3 3 --> 4 3 --> 5 +``` -
- If `3` has a reconcile pre-condition that is not met, `1` and `2` would be reconciled. However, DR `3`,`4`,`5` would be deleted: `4` and `5` would be deleted concurrently but `3` would only @@ -285,16 +284,14 @@ is not met, just for the whole workflow. `Deleter` interface, it is considered as deleted automatically. ### Sample - -
- + +```mermaid stateDiagram-v2 1 --> 2 1 --> 3 2 --> 4 3 --> 4 - -
+``` - The DRs are deleted in the following order: `4` is deleted first, then `2` and `3` are deleted concurrently, and, only after both are successfully deleted, `1` is deleted.