-
Notifications
You must be signed in to change notification settings - Fork 217
IllegalStateException: More than 1 secondary resource related to primary #1362
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
Hi @brainwang , this comes in the next version, until that time please don't use dependent resources for this use case. |
Thanks @csviri |
Good question, hard to tell because of the holiday season :) There are few important issues that has priority, see: https://github.com/java-operator-sdk/java-operator-sdk/milestone/3 My guestimate is mid September. |
(Note that this issue is already on that list) |
We might do an other release meanwhile, if we are able to settle a nice API for this. Will let you know asap. |
Will close this issue for now if no objections. |
@brainwang sorry forgot to mention that there is a workaround, to put labels on the resources, to distinguish them: in this way you can use multiple of them |
Bug Report
What did you do?
I developed a simple operator with 2 different ConfigMap as secondary resources.
What did you expect to see?
I hope it can be handled correctly
What did you see instead? Under which circumstances?
A runtime exception was throw:
Caused by: java.lang.IllegalStateException: More than 1 secondary resource related to primary
at io.javaoperatorsdk.operator.processing.event.source.ResourceEventSource.getSecondaryResource(ResourceEventSource.java:23)
at io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependentResource.getSecondaryResource(KubernetesDependentResource.java:213)
at io.javaoperatorsdk.operator.processing.dependent.AbstractDependentResource.reconcile(AbstractDependentResource.java:32)
at io.javaoperatorsdk.operator.processing.dependent.workflow.WorkflowReconcileExecutor$NodeReconcileExecutor.run(WorkflowReconcileExecutor.java:165)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
Environment
vanilla Kubernetes
$ Mention java-operator-sdk version from pom.xml file
3.1.0
$ java -version
java 11.0.3 2019-04-16 LTS
$ kubectl version
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.4", GitCommit:"e6c093d87ea4cbb530a7b2ae91e54c0842d8308a", GitTreeState:"clean", BuildDate:"2022-02-16T12:38:05Z",
GoVersion:"go1.17.7", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.13", GitCommit:"80ec6572b15ee0ed2e6efa97a4dcd30f57e68224", GitTreeState:"clean", BuildDate:"2022-05-24T12:34:37Z"
, GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: