Skip to content
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

Feature request: allow setting settings in nexus.properties (feature flags, etc) #204

Closed
ibotty opened this issue Apr 13, 2021 · 18 comments · Fixed by #212
Closed

Feature request: allow setting settings in nexus.properties (feature flags, etc) #204

ibotty opened this issue Apr 13, 2021 · 18 comments · Fixed by #212
Assignees
Labels
RFE 🙏 Request For Enhancements
Milestone

Comments

@ibotty
Copy link

ibotty commented Apr 13, 2021

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).

@ibotty ibotty added the RFE 🙏 Request For Enhancements label Apr 13, 2021
@ricardozanini
Copy link
Member

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?

@ricardozanini ricardozanini self-assigned this Apr 22, 2021
@ibotty
Copy link
Author

ibotty commented Apr 22, 2021

Thank you for considering!

Regarding the question: yes, a ConfigMap would work as well.

@ricardozanini ricardozanini added this to the v0.6.0 milestone Apr 22, 2021
@ibotty
Copy link
Author

ibotty commented May 28, 2021

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.

@ricardozanini
Copy link
Member

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.

@ibotty
Copy link
Author

ibotty commented May 31, 2021

Uiuiui. I am flattered! Looking forward to it.

@ricardozanini
Copy link
Member

@ibotty
Copy link
Author

ibotty commented Jun 3, 2021

Yeah, I know about that feature. That was missing (not only because of configmap changes).

@ricardozanini
Copy link
Member

Oh that's a reference for myself :)

@ricardozanini
Copy link
Member

@ibotty are you able to test the feature if I build an image for you? See #212

@ibotty
Copy link
Author

ibotty commented Jun 14, 2021

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.

@ricardozanini
Copy link
Member

hmmm, you can install it manually in a local environment and update the Deployment image with the one I'll build for you.

@ibotty
Copy link
Author

ibotty commented Jun 14, 2021

Well, yes. I can certainly test it.

@ricardozanini
Copy link
Member

@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.

LCaparelli pushed a commit that referenced this issue Aug 17, 2021
* Closes #204 - Mounting nexus.properties in a ConfigMap

Signed-off-by: Ricardo Zanini <[email protected]>

* Fixing Operatorr SDK install script

Signed-off-by: Ricardo Zanini <[email protected]>

* Fixing curl output

Signed-off-by: Ricardo Zanini <[email protected]>

* Incorporating java properties to Nexus CR

Signed-off-by: Ricardo Zanini <[email protected]>

* Lint fix and addheaders downgrade

Signed-off-by: Ricardo Zanini <[email protected]>

* Explicit set Red Hat image to Dockerbuild and fix permission issues

Signed-off-by: Ricardo Zanini <[email protected]>
@ibotty
Copy link
Author

ibotty commented Oct 26, 2021

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"'

@ibotty
Copy link
Author

ibotty commented Oct 26, 2021

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.

@ricardozanini
Copy link
Member

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?

@ibotty
Copy link
Author

ibotty commented Oct 26, 2021

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

@ricardozanini
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFE 🙏 Request For Enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants