-
Notifications
You must be signed in to change notification settings - Fork 202
mvn fabric8:resource converts types of kubernetes YAML annotations in fragment #1714
Comments
I am experiencing a similar problem, but probably with the same cause. I think the issue here is the rather odd boolean datatype in YAML: https://yaml.org/type/bool.html. The fix in f-m-p could be to NOT remove quotes when the qouted value is in the YAML boolean regex range. A potential workaround could have been to transform the resource fragment into JSON - as f-m-p supports both YAML and JSON. But that does not work because f-m-p seems to use YAML as the "canonical dataformat" for generated resources. And the generated YAML resources (from a JSON resource fragments) still has the wrong unquoted value.... @rohanKanojia : Any chance of getting this fixed for the upcoming f-m-p release? I am trying to deploy Kong using fabric8-maven-plugin. The Kong image supports configuration of the database type through the environment variable KONG_DATABASE, and the supported values are (postgres, cassandra, off). In my deployment resource fragment I tried with (starting from kong-dist-kubernetes): The generated resources from fabric8-maven-plugin (in target/classes/META-INF/fabric8/) transforms this into: Notice how the quotes are removed from the value.... When I then run the apply goal to apply the generated resources to my Openshift Cluster, this results in the following YAML (from my Openshift deployment config): Which results in my pod ending up in a Crash Loop Back-off with the following error message: Error: database has an invalid value: 'false' (postgres, cassandra, off) |
I have just tested this with the 4.3-SNAPSHOT version, built from the master branch. And same behavior.... |
… YAML annotations in fragment Modified Jackson ObjectMapper to disable minimizing quotes in case of yamls
… YAML annotations in fragment Modified Jackson ObjectMapper to disable minimizing quotes in case of yamls
… YAML annotations in fragment Modified Jackson ObjectMapper to disable minimizing quotes in case of yamls
…otations in fragment Modified Jackson ObjectMapper to disable minimizing quotes in case of yamls
A way to avoid this -- and this might be user error on my part -- is to specify the type tag: Still, it's irritating and is more a yaml thing than anything f-m-p related |
@nimish : Single quotes should be enough to make it into a YAML string. I suspect that there is a bug in jackson-dataformats-text (or in one of the dependencies).... |
…bernetes YAML annotations in fragment" This reverts commit c64d894
…bernetes YAML annotations in fragment" This reverts commit c64d894
…oduced Jackson BOM.
…oduced Jackson BOM.
…oduced Jackson BOM. DM on snakeyaml.
…s with YAML boolean values
Description
Info
mvn -v
) : 3.6.2After doing whatever it does to an ingress resource fragment (taken from the nginx ingress controller examples), the f-m-p will emit:
Note the lack of quotes. This results in the warning:
[message=.metadata.annotations.nginx.ingress.kubernetes.io/auth-tls-verify-client: boolean found, string expected, violation type=type]
The difference matters quite a bit as the wrong type will stop the ingress controller from actually enforcing client certificate auth...
The text was updated successfully, but these errors were encountered: