Skip to content

refactor: isolate bulk dependent resource handling more #1530

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 6 commits into from
Oct 12, 2022
Merged

Conversation

metacosm
Copy link
Collaborator

@metacosm metacosm commented Oct 7, 2022

No description provided.

Copy link
Collaborator

@csviri csviri left a comment

Choose a reason for hiding this comment

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

Went through this briefly, tbh I have mixed feelings. I agree that this is kinda more structured, but also was much harder to follow the flow of the execution, since bidirectional references etc. There are some parts that is not entirely clear for me, will take a deeper look on that tomorrow.

}
}

private static class UpdatableBulkDependentResourceInstance<R, P extends HasMetadata>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't get why this is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is needed so that we can have the exact same interface for a "single" or bulk dependent in AbstractDependentResource.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More specifically, this is needed to be able to do this: https://github.com/java-operator-sdk/java-operator-sdk/pull/1530/files#diff-0d27f73ffef40826943dbbef3e9a2a1e74e2a10341627042ffa5a792d03c3638R39. In order to do it this way, the objects we iterate over need to be AbstractDependentResources.

Copy link
Collaborator

@csviri csviri left a comment

Choose a reason for hiding this comment

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

I made a comment where it is not clear to me why that is needed. But otherwise although it makes it harder imho to read/follow the flow of the exection, it seprates the two type of logic, let's see how it work out.

@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 20 Code Smells

22.0% 22.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.

2 participants