Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

One-to-many example#1522

LarsKrogJensen started this conversation inGeneral
Oct 5, 2022· 1 comments· 3 replies
Discussion options

Hi,

I am looking at solving a custom controller that needs to map one CR to several (1..n) secondary resources (ServiceEntry), cannot seem to find any tests, samples or docs around this scenario.

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

@LarsKrogJensen using the low level API or Dependent Resources ?

You must be logged in to vote
3 replies
@LarsKrogJensen
Comment options

Preferably Dependent Resource

@csviri
Comment options

That is not released yet, see:#1182
Will come in 4.1. See related integration tests in the PR. Note that this API will change a little bit, if you are interested:#1521
But probably more improvements will come.

With low level API you can just simply create the resources, in a for loop. Add the owner refereces as in samples. And on next reconciliation just read them usingcontext.getSecondaryResources() and reconcile them.

https://github.com/java-operator-sdk/java-operator-sdk/blob/affc610de37225d425b8b961f61c2506a2113d30/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Context.java#L18-L18

Using some naming convention in the name of the resource to address / identify them.

@LarsKrogJensen
Comment options

Oh how nice, was looking at open PR:s but seems to have missed this one.

The Dependent Resource api is really, really nice so I will have a look at the PR and wait for the the 4.1 release.

Thanks a lot

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@LarsKrogJensen@csviri

[8]ページ先頭

©2009-2025 Movatter.jp