-
Notifications
You must be signed in to change notification settings - Fork 51
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
context.getSecondaryResource does not return related namespace when quarkus.operator-sdk.namespaces is used #746
Comments
Which version of the Quarkus extension are you using? |
Hi, I have similar behavior on:
In app logs I do not see any exceptions/error except my app business exception because namespace is undefined. In dev/test use case operator should monitor only one dedicated namespace for CertificateRequest and as secondary resources it should return exactly (and only) that dedicated namespace not others (in withPrimaryToSecondaryMapper new ResourceID(certificateRequest.getMetadata().getNamespace()) ). Thanks. Regards, |
The problem, as mentioned before, if you set your controller to watch only one namespace, it doesn't have cluster-wide access, which means it cannot retrieve namespaces, which are clustered resources. I will take a look to see what, if anything, we can do. |
Closing this and re-opened the associated JOSDK issue. See operator-framework/java-operator-sdk#2114 (comment) for more details. However, I'm afraid that what you're trying to do is not feasible at the Kubernetes level. |
Bug Report
What did you do?
We create controller for cert-manager CertificateRequest CRD. Controller logic is based on CertificateRequest and namespace metadata in which CertificateRequest reside. That is why we declared namespace as secondary resource.
For production deployment controller observe all namespaces and for dev/test deployment only one dedicated namespace.
That is why in:
we placed:
but in application.properties we did not.
What did you expect to see?
We expect that in both cases (production and dev/test)
(in code snippet marked as (1) ) always return related namespace.
What did you see instead? Under which circumstances?
In production case it works, but in dev/test it does not returning related namespace, instead empty optional.
Environment
Kubernetes cluster type:
OpenShift v4.12
$ Mention java-operator-sdk version from pom.xml file
The same behaviour for io.javaoperatorsdk:operator-framework-core:
$ java -version
JDK 17
$ kubectl version
$ oc version
Client Version: 4.12.0-202308291001.p0.gac58b18.assembly.stream-ac58b18
Kustomize Version: v4.5.7
Server Version: 4.12.34
Kubernetes Version: v1.25.12+26bab08
The text was updated successfully, but these errors were encountered: