Skip to content

Allow empty virtual directory #7

@KharchenkoMaks

Description

@KharchenkoMaks

The Docker configuration added support to set WPR_VIRTUAL_DIR to / or "" to serve the application from the root path in WebSpellChecker/wproofreader-docker#83. However, setting virtualDir: / (or virtualDir: "") in the Helm chart values.yaml produces malformed paths in the generated manifests.

Root cause

Path strings in deployment.yaml and NOTES.txt are constructed by directly interpolating .Values.virtualDir into a template string with hardcoded slashes:

path: /{{ .Values.virtualDir }}                  # becomes //
path: "/{{ .Values.virtualDir }}/api?cmd=status" # becomes ///api?cmd=status
printf ".../%s/" .Values.virtualDir              # becomes .../  /

Expected behavior

virtualDir value Liveness path Readiness path
wscservice (default) /wscservice/ /wscservice/api?cmd=status
/ or "" / /api?cmd=status

What should be tested

  • Default install (virtualDir: wscservice) — liveness and readiness probe paths render as /wscservice/ and /wscservice/api?cmd=status
  • Root install (virtualDir: /) — probe paths render as / and /api?cmd=status, no double slashes
  • Empty string install (virtualDir: "") — same as root, no double slashes
  • NOTES.txt base URL renders correctly for all three cases above (no double slashes)
  • WPR_VIRTUAL_DIR env var in the Deployment is passed to the container unchanged (not normalized)
  • Service is reachable and returns a valid response at http://localhost/api?cmd=status when deployed with virtualDir: /

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions