Feature request: allow setting settings in nexus.properties (feature flags, etc)
ibotty opened this issue · comments
Is your feature request related to a problem? Please describe.
Feature Request to make it possible to set properties traditionally set in a nexus.properties file.
It would be great have a setting in the CRD where one could set them. But any way would be fine.
I need the feature flag nexus.conan.hosted.enabled=true
(from https://issues.sonatype.org/browse/NEXUS-23629).
Hi! Thanks for opening this issue! I need to wrap up some issues to release 0.6. I'll definitely add this one to the planning.
What about a configMap mapped to this property file?
Thank you for considering!
Regarding the question: yes, a ConfigMap
would work as well.
No pressure, but do you have an estimate on when v0.6.0 with that feature might be released?
I might find time to add the feature myself if you could give me a hint on where to start and what's necessary. I am not familiar with OperatorSDK.
Hey @ibotty! I'm currently working on it. We will probably ship 0.6.0 with only this feature for you :)
I'll have more to share by the end of the week.
Uiuiui. I am flattered! Looking forward to it.
Yeah, I know about that feature. That was missing (not only because of configmap changes).
Oh that's a reference for myself :)
Yes, but I am not sure exactly how, because I am running the operator from OLM, andI don't know how to actually use another image. I will try to find a way though.
hmmm, you can install it manually in a local environment and update the Deployment
image with the one I'll build for you.
Well, yes. I can certainly test it.
@ibotty sorry for taking so long, I have a limited time to work on this operator. Can you try in your environment? Just apply this file:
https://gist.github.com/ricardozanini/b59ebc4b5267ddcb91abcdf5e9d270d7
Please use a test environment where you don't have the Nexus Operator installed.
Also see #212 for further discussions. There's an update in the README explaining how to configure your Nexus server using Spec.Properties
field in your CR.
I finally got around to testing it. the nexus deployment's container does write the following log line, so your part works great. I still cannot get the remote to show, but that's a different problem not related to this operator. Thank you!
2021-10-26 10:02:10,133+0000 INFO [FelixStartLevel] *SYSTEM org.sonatype.nexus.bootstrap.ConfigurationBuilder - nexus.conan.hosted.enabled='"true"'
I spoke too soon. When stopping the operator and changing the configmap from
nexus.conan.hosted.enabled: "true"
to
nexus.conan.hosted.enabled: true
it worked. It seems not as easy as thought, because the type seems to matter and can't be set in the nexus
crd.
hmmm, so you have to remove the quotes in order to make it work? We can do a sanitize check to boolean and numeric values to write them without quotes. WDYT?
Yes, I had to remove the quotes.
I am not sure what the best solution is going to be.
I believe sanitizing is not a foolproof approach. When people want to set a property to the string "true", it will fail. It feels fragile.
The cleanest solution would be to allow any type of map. I am not sure, whether kubernetes (tooling) supports it though, because that feature would be great for many core kubernetes things (annotations, etc) and it does not work in these instances.
The other option I can think of is having the properties of type string:
properties: |
nexus.conan.hosted.enabled: true
I need to circle back on this and see what's the best approach. I think adding something like:
myprops:
- boolean.prop: true
- string.prop: "true"
It should be enough.