Skip to content

Allow empty virtual directory#8

Open
KharchenkoMaks wants to merge 2 commits intomainfrom
root_virtual_dir
Open

Allow empty virtual directory#8
KharchenkoMaks wants to merge 2 commits intomainfrom
root_virtual_dir

Conversation

@KharchenkoMaks
Copy link

Fix double slashes in paths when virtualDir is set to root

Closes #7

Issue

Setting virtualDir: / or virtualDir: "" to deploy WProofreader at the root path caused malformed double-slash paths in probe definitions and the post-install notes URL, because .Values.virtualDir was interpolated directly into strings that already contained surrounding
slashes.

Solution

Added a single reusable helper wproofreader.virtualDirBasePath to _helpers.tpl that normalizes virtualDir into a consistent path prefix:

  • "wscservice""/wscservice"
  • "/" or """" (empty string)

This allows all call sites to append their path suffix directly without any per-use-case branching:

{{ include "wproofreader.virtualDirBasePath" . }}/api?cmd=status
-> "/wscservice/api?cmd=status"  (default)
-> "/api?cmd=status"             (root)

Changes

File Change
templates/_helpers.tpl Added wproofreader.virtualDirBasePath helper
templates/deployment.yaml Liveness and readiness probe paths now use the helper
templates/NOTES.txt Base URL construction now uses the helper
values.yaml Replaced WPR_DOMAIN_NAME example by WPR_JVM_MAX_MEMORY_SIZE_MB

Notes

  • The WPR_VIRTUAL_DIR env var passed to the container is intentionally not normalized — the container accepts / and "" natively.
  • All existing deployments with the default virtualDir: wscservice are unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow empty virtual directory

2 participants