Comments (2)
Seems like the features also creates issues, if mappings are created from a config map in k8s: holomekc#269
from wiremock.
Kubernetes mounts a ConfigMap
containing just 2 unique stub mappings like this:
root@wiremock-66dc8ccf9b-2z8m2:/home/wiremock/mappings# ls -laR
.:
total 0
drwxrwxrwx. 3 root root 152 Jul 5 13:51 .
drwxr-xr-x. 1 root root 25 Jul 5 13:52 ..
drwxr-xr-x. 2 root root 98 Jul 5 13:51 ..2024_07_05_13_51_53.2567708330
lrwxrwxrwx. 1 root root 32 Jul 5 13:51 ..data -> ..2024_07_05_13_51_53.2567708330
lrwxrwxrwx. 1 root root 23 Jul 5 13:51 jwks.json -> ..data/jwks.json
lrwxrwxrwx. 1 root root 31 Jul 5 13:51 webhook-test.json -> ..data/webhook-test.json
./..2024_07_05_13_51_53.2567708330:
total 12
drwxr-xr-x. 2 root root 98 Jul 5 13:51 .
drwxrwxrwx. 3 root root 152 Jul 5 13:51 ..
-rw-r--r--. 1 root root 264 Jul 5 13:51 jwks.json
-rw-r--r--. 1 root root 432 Jul 5 13:51 webhook-test.json
Wiremock detects soft-linked files as well as the 'real' files inside the hierarchy as duplicates regardless of the file type and identical MD5 checksum:
MB-79-P16:wiremock $ md5sum mappings/..2024_07_05_13_51_53.2567708330/webhook-test.json mappings/webhook-test.json
eb58ef4b72a411579d764c4d540ca1ae mappings/..2024_07_05_13_51_53.2567708330/webhook-test.json
eb58ef4b72a411579d764c4d540ca1ae mappings/webhook-test.json
Exception in thread "main" com.github.tomakehurst.wiremock.common.InvalidInputException: {
"errors" : [ {
"code" : 109,
"title" : "Duplicate stub mapping ID",
"detail" : "ID of the provided stub mapping '64c23b4a-5f94-427b-8b6e-f8c43ed5529d' is already taken by another stub mapping"
} ]
}
at com.github.tomakehurst.wiremock.stubbing.AbstractStubMappings.addMapping(AbstractStubMappings.java:169)
at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto(JsonFileMappingsSource.java:120)
at com.github.tomakehurst.wiremock.core.WireMockApp.loadMappingsUsing(WireMockApp.java:288)
at com.github.tomakehurst.wiremock.core.WireMockApp.loadDefaultMappings(WireMockApp.java:282)
at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:143)
at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74)
at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:71)
at wiremock.Run.main(Run.java:23)
My current work-around is using an init-container which find and copy just all real files from the k8s mounted directory to the mappings
directory (find /home/wiremock/configmap-mappings/ -type f -exec cp '{}' /home/wiremock/mappings/ \;
), which is somehow cumbersome.
from wiremock.
Related Issues (20)
- FileItemPartAdapter returning multipart's field name instead of a filename
- Avoiding reading zipfile entries repeatedly in ClasspathFileSource
- Support disabled state for stub mappings HOT 1
- Add a unique id to the template request model
- Add self-description callback(s) to MatchResult for use in Diff
- Report webhook errors and results as sub-events
- Support mTLS (client certificate) for standalone WireMock client
- urlPathTemplate does not work in combination with queryParameters HOT 1
- Allow loading a stub for a single file instead of a directory
- No command line option to set template escape disabled to false
- ID reported as already taken when registering a single stub HOT 2
- Optimal order of offsetting and truncating expected date/time values
- Recording fails when JSON in a request was invalid
- could not find helper: "jsonMerge" HOT 3
- Add idle timeout configuration when running as forward (browser) proxy
- Add support for HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables
- PatternSyntaxException in PathTemplate.SPECIAL_SYMBOL_REGEX on Android HOT 1
- Support removeAndGet method on stores
- Support for configuring cipher suites of WiremockServer in WireMockConfiguration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wiremock.