Skip to content

Add wstunnel debug level and external template support#42

Draft
dciangot wants to merge 1 commit into
mainfrom
claude/wstunnel-debug-template-flags-1HJ6A
Draft

Add wstunnel debug level and external template support#42
dciangot wants to merge 1 commit into
mainfrom
claude/wstunnel-debug-template-flags-1HJ6A

Conversation

@dciangot

Copy link
Copy Markdown
Member

Introduces new configuration options for wstunnel:

  1. Debug Level Control:

    • Added wstunnelDebugLevel flag in values.yaml (default: "DEBUG")
    • Supports standard log levels: DEBUG, INFO, WARN, ERROR
    • Updated wstunnel-template_nginx.yaml and wstunnel-template_traefik.yaml to use variable
    • Config passed through InterLinkConfig.yaml to wstunnel templates
  2. External Template Reference:

    • Added externalTemplate flag to reference local files or ConfigMap names
    • Added useExternalConfigMap flag to use existing ConfigMap instead of creating one
    • Priority: externalTemplate > customTemplate > templateType > default

Usage examples:

  • Set debug level: virtualNode.network.wstunnelDebugLevel: "INFO"
  • Use local file: virtualNode.network.externalTemplate: "my-custom-template.yaml"
  • Use ConfigMap: virtualNode.network.externalTemplate: "my-configmap" and useExternalConfigMap: true

Summary


Related issue :

Introduces new configuration options for wstunnel:

1. Debug Level Control:
   - Added wstunnelDebugLevel flag in values.yaml (default: "DEBUG")
   - Supports standard log levels: DEBUG, INFO, WARN, ERROR
   - Updated wstunnel-template_nginx.yaml and wstunnel-template_traefik.yaml to use variable
   - Config passed through InterLinkConfig.yaml to wstunnel templates

2. External Template Reference:
   - Added externalTemplate flag to reference local files or ConfigMap names
   - Added useExternalConfigMap flag to use existing ConfigMap instead of creating one
   - Priority: externalTemplate > customTemplate > templateType > default

Usage examples:
- Set debug level: virtualNode.network.wstunnelDebugLevel: "INFO"
- Use local file: virtualNode.network.externalTemplate: "my-custom-template.yaml"
- Use ConfigMap: virtualNode.network.externalTemplate: "my-configmap" and useExternalConfigMap: true

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Helm values to control wstunnel server log level and to optionally source the wstunnel template from an external file (packaged with the chart) or an existing ConfigMap, wiring these settings through the generated InterLinkConfig and wstunnel templates.

Changes:

  • Parameterize wstunnel server --log-lvl via virtualNode.network.wstunnelDebugLevel.
  • Add externalTemplate and useExternalConfigMap values to control where the wstunnel template is sourced from, and adjust template ConfigMap creation/mounting accordingly.
  • Propagate WstunnelDebugLevel into InterLinkConfig.yaml for downstream template rendering.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
interlink/wstunnel-template_traefik.yaml Uses templated {{.WstunnelDebugLevel}} for wstunnel server log level.
interlink/wstunnel-template_nginx.yaml Uses templated {{.WstunnelDebugLevel}} for wstunnel server log level.
interlink/values.yaml Introduces externalTemplate, useExternalConfigMap, and wstunnelDebugLevel chart values.
interlink/templates/virtual-kubelet.yaml Switches the mounted ConfigMap name when using an externally managed ConfigMap.
interlink/templates/virtual-kubelet-config.yaml Adds WstunnelDebugLevel to InterLinkConfig and implements external-template precedence when creating the template ConfigMap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread interlink/values.yaml
# Custom wstunnel template content (optional, overrides templateType if set)
customTemplate: ""
# External template reference (overrides customTemplate and templateType if set)
# Can be a local file path (e.g., "wstunnel-template_custom.yaml") or ConfigMap name

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

externalTemplate is documented as accepting a "local file path", but the chart uses .Files.Get to load it, which only reads files packaged inside the Helm chart. If users set an arbitrary local path at install time, Helm will fail with a "file not found" render error. Please clarify the comment to indicate it must be a chart file path (or recommend using customTemplate/--set-file for truly local content).

Suggested change
# Can be a local file path (e.g., "wstunnel-template_custom.yaml") or ConfigMap name
# When useExternalConfigMap is false, this must be a path to a file packaged inside this Helm chart
# (for example, "wstunnel-template_custom.yaml"), not an arbitrary local filesystem path.
# For truly local content at install/upgrade time, use customTemplate or --set-file instead.

Copilot uses AI. Check for mistakes.
- name: wstunnel-template
configMap:
{{- if .Values.virtualNode.network.useExternalConfigMap }}
name: {{ .Values.virtualNode.network.externalTemplate }}

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When useExternalConfigMap is true, the ConfigMap name is taken directly from virtualNode.network.externalTemplate. If externalTemplate is empty (the default), this will render an invalid volume reference and the Pod will fail to start. Consider enforcing that externalTemplate is non-empty when useExternalConfigMap is true (e.g., using Helm's required function or by adding a conditional that errors out).

Suggested change
name: {{ .Values.virtualNode.network.externalTemplate }}
name: {{ required "virtualNode.network.externalTemplate must be set when virtualNode.network.useExternalConfigMap is true" .Values.virtualNode.network.externalTemplate }}

Copilot uses AI. Check for mistakes.
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.

3 participants