-
Notifications
You must be signed in to change notification settings - Fork 220
feat: remove primary to secondary mapper (handled automatically) #1161
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
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a19f558
feat: remove primary to secondary mapper (handled automatically)
csviri 014a93e
feat: added integration test
csviri bc3b193
fix: format
csviri 38a2a66
fix: minor issues
csviri cd0fefe
minor fix
csviri c0759e4
wip
csviri 28d0356
fix: indexing and temp cache
csviri c7f56f9
fix: index
csviri bc591cf
fix: format
csviri b56472b
fix: index issue
csviri ba22186
added unit tests
csviri 8bd61fc
fix: get secondary resources
csviri 6249306
generics improvements
csviri e5c8dcc
smell fix
csviri 93e11a6
fix: revert explicit owner refereces
csviri dfc2253
remove smell
csviri 867b3cb
fix: remove get secondary resources by name
csviri 69af272
code review fixes
csviri e43cec5
fixed comment from CR
csviri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...amework-core/src/main/java/io/javaoperatorsdk/operator/processing/MultiResourceOwner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.javaoperatorsdk.operator.processing; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import io.fabric8.kubernetes.api.model.HasMetadata; | ||
|
||
public interface MultiResourceOwner<R, P extends HasMetadata> extends ResourceOwner<R, P> { | ||
|
||
default Optional<R> getSecondaryResource(P primary) { | ||
var list = getSecondaryResources(primary); | ||
if (list.isEmpty()) { | ||
return Optional.empty(); | ||
} else if (list.size() == 1) { | ||
return Optional.of(list.get(0)); | ||
} else { | ||
throw new IllegalStateException("More than 1 secondary resource related to primary"); | ||
} | ||
|
||
} | ||
|
||
List<R> getSecondaryResources(P primary); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
...in/java/io/javaoperatorsdk/operator/processing/event/source/PrimaryToSecondaryMapper.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't this be a Set instead of List, actually? Don't we want to return unique resources? Also, there's no ordering there so a List is not required.
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.
Fine with that will change.