Closed metacosm closed 1 year ago
/cc @Sgitario (kubernetes), @geoand (devservices,kubernetes), @iocanel (kubernetes), @stuartwdouglas (devservices)
you see k3-s need to be passed to what/where exactly?
confirmed the bug using:
quarkus.kubernetes-client.devservices.flavor=k3s
gives you:
Caused by: java.lang.IllegalArgumentException: SRCFG00039: The config property quarkus.kubernetes-client.devservices.flavor with the config value "k3s" threw an Exception whilst being converted Cannot convert k3s to enum class io.quarkus.kubernetes.client.runtime.KubernetesDevServicesBuildTimeConfig$Flavor
at io.smallrye.config.SmallRyeConfig.convertValue(SmallRyeConfig.java:284)
at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:242)
at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigValue(BuildTimeConfigurationReader.java:838)
... 27 more
Caused by: java.lang.IllegalArgumentException: Cannot convert k3s to enum class io.quarkus.ku
It would actually be helpful for SmallRye to output the existing values in this situation as this would help users figure out what's wrong without having to debug the code.
I guess changing the enum value to lowercase will avoid introducing hyphens when using an acronym. Or use a specific converters. Let me know what the better I'll do the PR.
Lowercase is probably the easiest solution, yes! 👍
t would actually be helpful for SmallRye to output the existing values in this situation as this would help users figure out what's wrong without having to debug the code.
That's an interesting idea. Please open a new issue for that
It's unfortunate that we add a hyphen on the digit-to-letter boundary. I can only guess that I was thinking e.g. Inet4Address
should be inet4-address
rather than inet4address
(for example). I did have a small corpus of test strings but it was fairly limited.
We might consider updating these hyphenation rules to be somewhat more intuitive for a larger corpus of inputs, and then (maybe) add a flag for legacy behavior (or else require explicit names for those cases).
In the meantime I agree that it would be a good idea to update the converter for enums as described in smallrye/smallrye-config#930.
Description
The k3s flavour needs to be passed as
k3-s
due to how SmallRye enumeration names conversions. That name is rather awkward and is not properly documented. Ideally, it should be namedk3s
but if it's not possible, the proper name should be documented accordingly.Implementation ideas
No response