Skip to content

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

Closed
brainwang opened this issue Jul 24, 2022 · 7 comments
Closed
Assignees

Comments

@brainwang
Copy link

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

@csviri
Copy link
Collaborator

csviri commented Jul 25, 2022

Hi @brainwang ,

this comes in the next version, until that time please don't use dependent resources for this use case.
See: #1175

@brainwang
Copy link
Author

Thanks @csviri
Could you please tell me when the next release will be out?

@csviri
Copy link
Collaborator

csviri commented Jul 25, 2022

Could you please tell me when the next release will be out?

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.

@csviri
Copy link
Collaborator

csviri commented Jul 25, 2022

(Note that this issue is already on that list)

@csviri
Copy link
Collaborator

csviri commented Jul 25, 2022

We might do an other release meanwhile, if we are able to settle a nice API for this. Will let you know asap.

@csviri csviri self-assigned this Jul 26, 2022
@csviri
Copy link
Collaborator

csviri commented Jul 26, 2022

Will close this issue for now if no objections.

@csviri csviri closed this as completed Jul 26, 2022
@csviri
Copy link
Collaborator

csviri commented Jul 26, 2022

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants