Skip to content

feat: dependent resource in the condition instead of resource #1690

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

Merged
merged 3 commits into from
Jan 10, 2023

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Jan 2, 2023

No description provided.

@csviri csviri self-assigned this Jan 2, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 2, 2023

Please retry analysis of this Pull-Request directly on SonarCloud.

@csviri csviri changed the base branch from main to next January 2, 2023 14:07
@csviri csviri marked this pull request as ready for review January 2, 2023 14:26
@csviri csviri requested a review from metacosm January 2, 2023 14:26
@csviri csviri marked this pull request as draft January 2, 2023 14:27
@csviri
Copy link
Collaborator Author

csviri commented Jan 2, 2023

Will add migration guide.

* @param context the current reconciliation {@link Context}
* @return {@code true} if the condition holds, {@code false} otherwise
*/
boolean isMet(P primary, R secondary, Context<P> context);
boolean isMet(DependentResource<R, P> dependentResource, P primary, Context<P> context);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe keep the order that was there before (i.e. primary as first param)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, don't, have a strong opinion on that. Changed this because the condition applies primarily to a dependent resource, so that's why it is on first place (kinda leading or priority)

@metacosm
Copy link
Collaborator

metacosm commented Jan 2, 2023

We should add an example where the dependent resource is actually used because, as it stands, this change only seems to complicate things while not actually addressing any particular issue…

@csviri
Copy link
Collaborator Author

csviri commented Jan 2, 2023

We should add an example where the dependent resource is actually used because, as it stands, this change only seems to complicate things while not actually addressing any particular issue…

when this will be merged: #1688
I will adjust that sample for this case.

@csviri csviri marked this pull request as ready for review January 3, 2023 09:25
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

80.0% 80.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condition API for Dependent Resources Should Contain the Dependent Resource not the Actual Resource
2 participants