-
Notifications
You must be signed in to change notification settings - Fork 219
docs: dependent resources #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
will take a look on this failing integration test in a separate PR |
A -- Yes --> match | ||
A -- No --> compute | ||
|
||
compute[Compute desired state based on primary state] --> Create --> Done | ||
match{Matches desired state as defined by primary?} | ||
match -- Yes --> Done | ||
match -- No --> Update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A -- Yes --> match | |
A -- No --> compute | |
compute[Compute desired state based on primary state] --> Create --> Done | |
match{Matches desired state as defined by primary?} | |
match -- Yes --> Done | |
match -- No --> Update | |
A -- Yes --> match | |
A -- No --> Create --> Done | |
match{Matches desired state as defined by primary?} | |
match -- Yes --> Done | |
match -- No --> Update --> Done |
Desired state is computed if both cases, why are you making the difference ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not actually. In the update case, the full desired state is only computed if the matcher didn't do it as it's often possible to check if the secondary resources match without computing the full desired state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not actually. In the update case, the full desired state is only computed if the matcher didn't do it as it's often possible to check if the secondary resources match without computing the full desired state.
Yes but to do Create or Update, you need to have a desired state in both case.
If the flow shows when the creatable desired state is computed, it should show when it is computed for Update branch.
Update is slightly more complex due to Matcher computed result can optionally provide a desired state. I thought it would make the whole picture a bit too detailed for an introduction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's part of the subtleties of getting the management of dependents right… 😉
But, indeed, it's probably too detailed for documentation purposes.
Controllers that deal with secondary resources typically need to perform the following steps, for | ||
each secondary resource: | ||
|
||
```mermaid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure Mermaid will not work with Jekyll out of the box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but we should be able to make it work by importing the JS lib. See https://codewithhugo.com/mermaid-js-hugo-shortcode/ for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, that would be awesome. Can try to take a look on that if you want.
0b5043d
to
8e89c61
Compare
@@ -0,0 +1,115 @@ | |||
--- | |||
title: Dependent Resources Feature description: Dependent Resources Feature layout: docs permalink: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunatelly formatter usually brokes this header of the file, just make sure that after format this part is reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I did it several times while writing the docs but I guess I need to deactivate automatic formatting on commits in my IDE.
|
||
### `DependentResource` vs. `AbstractDependentResource` | ||
|
||
The new `DependentResource` interface lies at the core of the design and strives to encapsulate the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would add links here to the code when referencing specific classes.
Kudos, SonarCloud Quality Gate passed! |
[skip-ci]
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
Co-authored-by: Sébastien CROCQUESEL <[email protected]>
[skip ci] Co-authored-by: Attila Mészáros <[email protected]>
8728633
to
9453108
Compare
Let's merge this and open subsequent PRs for more improvements. |
for just created branch and a skeleton (well a very skinny one), to start on the docs for dependent resources.
Will continue expanding this.