这是indexloc提供的服务,不要输入任何密码
Skip to content

Support rendering default templates relying on helpers #28

@gberche-orange

Description

@gberche-orange

Is your feature request related to a problem? Please describe.

As a hcunit user

  • in order to unit tests helm charts generated by the helm create command which include a dependency to _helpers.tpl template helper
  • I need hcunit to support specifying a template helper path

Observed behavior

at <include "my-chart.fullname" .>: error calling include: template: no template "my-chart.fullname" associated with template "gotpl"

where fullname is defined in the _helpers.tpl template helper

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "p-mysql.fullname" -}}
{{- if .Values.fullnameOverride }}
[...]

Describe the solution you'd like

I'd like to be able to render templates in unit tests for debugging purposes, without having access to a full-fledge kubernetes instance (e.g. as part of circle ci unit tests where a KIND is not yet available)

Describe alternatives you've considered

I've worked around the issue using helm install my-render-test --dry-run --debug ./my-chart/ --values ./my-chart/values.yaml on an environment with access to a K8S server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions