Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Generating resource yamls logs error because keys are not of type String #1695

Closed
a3aanwisse opened this issue Aug 26, 2019 · 1 comment
Closed
Labels
status/stale Issue/PR considered to be stale

Comments

@a3aanwisse
Copy link

Description

When running a mvn fabric8:build on our project the logging shows the following error:

F8: f8-healthcheck-spring-boot: Error while reading the spring-boot configuration: java.lang.IllegalArgumentException: Spring Boot configuration file my-module/target/classes/application.yml is not formatted correctly. Expected to find a key of type String but class java.lang.Integer with content 123 found.

The reason for this failure is the fact that our application.yml contains the following structure:

my:
  map:
    123: some-value
    456: another-value

The https://github.com/fabric8io/fabric8-maven-plugin/blob/master/core/src/main/java/io/fabric8/maven/core/util/YamlUtil.java reads the keys of the my.map as Integers instead of Strings.

So the code on line 69 throws an IllegalArgumentException, however Spring is OK if I use a map with a key of type Integer.

Suggestion: make code robust for other types OR change the Error in a Warning.

Info

  • f-m-p version : 4.1.0
  • Maven version (mvn -v) : 3.6.0
  • Kubernetes / OpenShift setup and version : not relevant
devang-gaur pushed a commit that referenced this issue Nov 4, 2019
* support integer keys in application.yaml

* Add changelog entry for #1695
@stale
Copy link

stale bot commented Nov 24, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale Issue/PR considered to be stale label Nov 24, 2019
@stale stale bot closed this as completed Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/stale Issue/PR considered to be stale
Projects
None yet
Development

No branches or pull requests

1 participant