-
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
Add namespace configuration for generated manifests #651
Conversation
This enables the manifests generated at build time to be customised with namespaces to watch without affecting the controllers themselves. This way the controllers can use default behaviour allowing them to be configured at runtime, and the manifests can be used to apply that configuration at runtime. Unfortunately, the logic to test for all namespaces and current namespaces in the Java operator SDK is in protected static methods, so I had to copy that logic into this project. It may be sensible to suggest that logic is made public in the Java operator SDK instead. Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
Hi @Jamstah, unless I'm misunderstanding your issue, I think that the |
More likely to be my misunderstanding that yours :) If I use this to build (new configuration from this PR):
And run with the env var:
I get this in the pod logs:
So at runtime, I successfully overrode the namespaces. If I use this to build:
And run with the env var:
I get this in the pod logs:
So the namespace can't be overridden (and I don't think there's an option for watch current either) In both cases, a RoleBinding not a ClusterRoleBinding is generated, which is what we're trying to find a property to do. |
Looks like JOSDK_WATCH_CURRENT does work today, but again cannot be overriden:
|
I'm still struggling to understand what you're trying to achieve outside of the different options you've tried. Could you explain, from a user's perspective, the use case you're trying to fulfil? Then we can figure out if something needs to change in QOSDK or if it's a matter of better documentation. Thanks in advance. |
Was writing that up in the keycloak PR, so to save duplicating the thread: keycloak/keycloak#21231 (comment) |
Thanks for the call today. I think we resolved that the behaviour of the QOSDK was buggy here:
Assuming that behaviour is changed, then this PR wouldn't be needed any more. |
Closed by #654 |
This enables the manifests generated at build time to be customised with namespaces to watch without affecting the controllers themselves. This way the controllers can use default behaviour allowing them to be configured at runtime, and the manifests can be used to apply that configuration at runtime.
Unfortunately, the logic to test for all namespaces and current namespaces in the Java operator SDK is in protected static methods, so I had to copy that logic into this project. It may be sensible to suggest that logic is made public in the Java operator SDK instead.
This came out of work being done for the keycloak oeprator here: keycloak/keycloak#21231