Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: kots template #4533

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

nvanthao
Copy link
Member

@nvanthao nvanthao commented Apr 2, 2024

What this PR does / why we need it:

It is currently difficult to debug templating error thrown by KOTS during install.

Which issue(s) this PR fixes:

Special notes for your reviewer:

This PR introduce new command kots template with 4 options to parse template.

  1. Parse raw template directly from --data flag.

E.g.

kots template --license-file license.yaml --config-values config.yaml --data '{{repl ConfigOption "hostname" | ToUpper }}'

MYHOST
  1. Parse template interactively. New REPL session will be created to parse template
kots template --license-file license.yaml --config-values config.yaml --interactive
  1. Parse template by file
kots template --license-file license.yaml --config-values config.yaml <path_to_template>
  1. Parse all templates in kotsKind directory, this behave similar to helm template where all files in kotsKind directory will be printed to stdout. The app will be pulled from upstream.
kots template --license-file license.yaml --config-values config.yaml 
  1. Parse all templates from local release.
kots template --license-file license.yaml --config-values config.yaml --local-path <path_to_release>

Does this PR introduce a user-facing change?

New command line command `kots template`

Does this PR require documentation?

Yes

@CLAassistant
Copy link

CLAassistant commented Apr 2, 2024

CLA assistant check
All committers have signed the CLA.

@nvanthao nvanthao added the type::feature New feature or request label Apr 2, 2024
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from f1567d3 to de3b613 Compare April 4, 2024 23:30
cmd/kots/cli/template.go Outdated Show resolved Hide resolved
pkg/pull/pull.go Outdated Show resolved Hide resolved
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from bd1eccf to 9517886 Compare April 8, 2024 03:53
@nvanthao nvanthao requested a review from cbodonnell April 14, 2024 23:12
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from a1f686f to d018228 Compare April 18, 2024 21:22
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from d018228 to c9d3ef3 Compare July 4, 2024 04:37
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from c9d3ef3 to 95bc109 Compare October 17, 2024 21:39
@nvanthao nvanthao force-pushed the gerard/sc-93245/f-template-render branch from 0089500 to 265d254 Compare January 9, 2025 00:56
cmd/kots/cli/template.go Outdated Show resolved Hide resolved
cmd/kots/cli/template.go Outdated Show resolved Hide resolved
@nvanthao nvanthao requested a review from laverya January 14, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants