Skip to content

Optional eventsource on dependent resources #1479

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 65 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
6e42e53
feat: improvements on caching and dependent resources
csviri Jul 27, 2022
7e3119c
wip
csviri Jul 27, 2022
ffc150b
fix
csviri Jul 27, 2022
7b16504
kubernetes dependent resource configuration
csviri Jul 28, 2022
7b442bc
IT fix
csviri Jul 28, 2022
f5fd957
fixed ITs
csviri Jul 29, 2022
d9d4a95
index based discriminator
csviri Jul 29, 2022
924f162
IT fix
csviri Jul 29, 2022
7eb4eb7
wip
csviri Jul 29, 2022
1f6b8b9
fixes from rebase from next
csviri Aug 26, 2022
c359557
fix after rebase
csviri Sep 5, 2022
e9c8c7e
event source provider to context
csviri Sep 6, 2022
2042fd8
todo fixes
csviri Sep 16, 2022
8f04146
remove void discriminator
csviri Sep 27, 2022
bdd2d96
rebase on next
csviri Sep 27, 2022
378f463
fix: bulk creation of dependent resource directly in abstract resource
csviri Sep 8, 2022
210034a
wip
csviri Sep 9, 2022
7a56e1c
wip
csviri Sep 9, 2022
bc4709c
wip to start IT
csviri Sep 9, 2022
2e96cd9
fixes, progress
csviri Sep 9, 2022
6892077
wp
csviri Sep 12, 2022
9d8055b
matcher
csviri Sep 12, 2022
e222735
test passes
csviri Sep 12, 2022
e55592d
bulk dependent resource to an interface
csviri Sep 13, 2022
b0a7227
wip
csviri Sep 14, 2022
88f0053
test improvement
csviri Sep 14, 2022
fe33446
note
csviri Sep 14, 2022
65705d4
wip
csviri Sep 15, 2022
58c4096
rebase on next
csviri Sep 20, 2022
6a4109b
increates test timeout
csviri Sep 20, 2022
5a3ac2d
comment
csviri Sep 20, 2022
50c6a0f
fix format
csviri Sep 20, 2022
b955396
wip
csviri Sep 20, 2022
069290d
delete, other improvements
csviri Sep 21, 2022
018e8c5
manage tests, refactored ITs
csviri Sep 21, 2022
a596b00
additionl IT
csviri Sep 21, 2022
bd6b9e7
external resource
csviri Sep 21, 2022
50a50b9
external resource IT
csviri Sep 22, 2022
3d07b2e
docs
csviri Sep 22, 2022
fe3bd1c
feat: optional event source from dependent resources
csviri Sep 16, 2022
efd2324
fix test
csviri Sep 22, 2022
ab1e980
wip
csviri Sep 23, 2022
34850d1
wip
csviri Sep 23, 2022
fc618d7
wip
csviri Sep 26, 2022
72ef5b6
wip
csviri Sep 26, 2022
5927d96
format
csviri Sep 27, 2022
6c87c40
fix
csviri Sep 27, 2022
b910139
IT skeleton
csviri Sep 27, 2022
ef67469
IT managed dependent resourc
csviri Sep 27, 2022
d80feed
IT improvement
csviri Sep 27, 2022
a6bee16
wip external resource handling
csviri Sep 27, 2022
94dff83
fix shortname
csviri Sep 27, 2022
5f6356e
IT
csviri Sep 27, 2022
a488572
feat: decouple event source from cache + list discriminator (#1378)
csviri Sep 28, 2022
7c66c05
bulk dependent resources (#1448)
csviri Sep 29, 2022
adef026
Merge branch 'next' into optional-eventsource-on-dr
csviri Sep 29, 2022
66882bc
fixes after merge
csviri Sep 29, 2022
d403291
Merge branch 'next' into optional-eventsource-on-dr
csviri Oct 3, 2022
ba64ed8
fixes after merge
csviri Oct 3, 2022
5a912a5
controller fix
csviri Oct 3, 2022
4576677
merge fixes
csviri Oct 3, 2022
55c3796
automatic event source selection
csviri Oct 3, 2022
964cf5a
fix
csviri Oct 3, 2022
9bad894
proper setting event source
csviri Oct 3, 2022
b86b6f7
fix: avoid NPE if no dependent resources are passed
metacosm Oct 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs
  • Loading branch information
csviri committed Sep 27, 2022
commit 3d07b2e1c7eb1e321e5b95e6aa0b8f481e583abe
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ private void adjustDiscriminators(int count) {
}

protected ReconcileResult<R> reconcileIndexAware(P primary, int i, Context<P> context) {
Optional<R> maybeActual = getSecondaryResourceIndexAware(primary, i, context);
Optional<R> maybeActual = bulk ? getSecondaryResourceIndexAware(primary, i, context)
: getSecondaryResource(primary, context);
if (creatable || updatable) {
if (maybeActual.isEmpty()) {
if (creatable) {
Expand Down Expand Up @@ -126,7 +127,6 @@ private R desiredIndexAware(P primary, int i, Context<P> context) {
: desired(primary, context);
}

// todo check
protected Optional<R> getSecondaryResource(P primary, Context<P> context) {
if (resourceDiscriminator.isEmpty()) {
return context.getSecondaryResource(resourceType());
Expand All @@ -136,14 +136,6 @@ protected Optional<R> getSecondaryResource(P primary, Context<P> context) {
}

protected Optional<R> getSecondaryResourceIndexAware(P primary, int index, Context<P> context) {
if (index > 0 && resourceDiscriminator.isEmpty()) {
throw new IllegalStateException(
"Handling resources in bulk bot no resource discriminators set.");
}
if (!bulk) {
return getSecondaryResource(primary, context);
}

return context.getSecondaryResource(resourceType(), resourceDiscriminator.get(index));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.javaoperatorsdk.operator.api.reconciler.Context;

/**
* Helper for the Bulk Dependent Resources to make it more explicit that bulk needs to only
* implement the index aware match method.
*
* @param <R> secondary resource type
* @param <P> primary resource type
*/
public interface BulkUpdater<R, P extends HasMetadata> extends Updater<R, P> {

default Matcher.Result<R> match(R actualResource, P primary, Context<P> context) {
Expand Down