Unable to use initializeJson with helm deployment on kubernetes
Describe the issue An error is thrown by mockserver when trying to load initializerJson.json file
What you are trying to do Deployed mockserver-config configmap, with initializerJson.json into my cluster, when mockserver starts, it throws file not found error.. Looks like there are extra quotes inserted.
MockServer version 5.11.1
To Reproduce Steps to reproduce the issue:
- Deploy mockserver with mockserver-config in kubernetes cluster
- expectations included in initializerJson.json file
- Expectations are NOT loaded. mockserver throws exception. See log below. Notice the extra quotes in the following:java.lang.RuntimeException: Exception while loading ""/config/initializerJson.json""
Expected behaviour initial expectations get loaded
MockServer Log 2021-01-06 21:20:56 5.11.1 INFO loading JSON initialization file:
"/config/initializerJson.json"
2021-01-06 21:20:56 5.11.1 WARNING exception while loading JSON initialization file, ignoring file
java.lang.RuntimeException: Exception while loading ""/config/initializerJson.json""
at org.mockserver.file.FileReader.readFileFromClassPathOrPath(FileReader.java:24)
at org.mockserver.server.initialize.ExpectationInitializerLoader.retrieveExpectationsFromJson(ExpectationInitializerLoader.java:83)
at org.mockserver.server.initialize.ExpectationInitializerLoader.loadExpectations(ExpectationInitializerLoader.java:115)
at org.mockserver.server.initialize.ExpectationInitializerLoader.addExpectationsFromInitializer(ExpectationInitializerLoader.java:37)
at org.mockserver.server.initialize.ExpectationInitializerLoader.
2021-01-06 21:20:56 5.11.1 INFO 1080 started on port: 1080 2021-01-06 21:20:56 5.11.1 INFO logger level is INFO, change using:
- 'ConfigurationProperties.logLevel(String level)' in Java code,
- '-logLevel' command line argument,
- 'mockserver.logLevel' JVM system property or,
- 'mockserver.logLevel' property value in 'mockserver.properties'
Update: This seems to be resolved if I use the 5.11.2 docker image. There is no 5.11.2 helm chart yet, so I am using the updated image with the (old) 5.11.1 chart. So far seems to be working fine, but it would be good if a corresponding 5.11.2 helm chart were made available, to capture any possible chart adjustments.
A helm chart has been release for all thee latest versions so closing this issue