kclhelm

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	// Lambda function to modify the Helm template output. Evaluated for each resource in the Helm template output.
	PostRenderer any `json:"postRenderer,omitempty"`
	// Helm value files to be passed to Helm template.
	ValueFiles []string `json:"valueFiles,omitempty"`
}

Defines a Helm chart.

func (*Chart) GenerateKCL

func (c *Chart) GenerateKCL(w io.Writer) error

type ChartBase

type ChartBase struct {
	// Helm values to be passed to Helm template. These take precedence over valueFiles.
	Values any `json:"values,omitempty"`
	// Helm chart name.
	Chart string `json:"chart"`
	// URL of the Helm chart repository.
	RepoURL string `json:"repoURL"`
	// Semver tag for the chart's version. May be omitted for local charts.
	TargetRevision string `json:"targetRevision,omitempty"`
	// Helm release name to use. If omitted the chart name will be used.
	ReleaseName string `json:"releaseName,omitempty"`
	// Optional namespace to template with.
	Namespace string `json:"namespace,omitempty"`
	// Validator to use for the Values schema.
	SchemaValidator jsonschema.ValidatorType `json:"schemaValidator,omitempty"`
	// Helm chart repositories.
	Repositories []ChartRepo `json:"repositories,omitempty"`
	// Set to `True` to skip the custom resource definition installation step (Helm's `--skip-crds`).
	SkipCRDs bool `json:"skipCRDs,omitempty"`
	// Set to `True` to skip templating Helm hooks (similar to Helm's `--no-hooks`).
	SkipHooks bool `json:"skipHooks,omitempty"`
	// Set to `True` to pass credentials to all domains (Helm's `--pass-credentials`).
	PassCredentials bool `json:"passCredentials,omitempty"`
}

Represents attributes common in `helm.Chart` and `helm.ChartConfig`.

func (*ChartBase) GenerateKCL

func (c *ChartBase) GenerateKCL(w io.Writer) error

type ChartConfig

type ChartConfig struct {
	// Schema generator to use for the Values schema.
	SchemaGenerator jsonschema.GeneratorType `json:"schemaGenerator,omitempty"`
	// Path to the schema to use, when relevant for the selected schemaGenerator.
	SchemaPath string `json:"schemaPath,omitempty"`
	// Configuration for value inference via dadav/helm-schema. Requires
	// schemaGenerator to be set to `VALUE-INFERENCE`.
	ValueInference *ValueInferenceConfig `json:"valueInference,omitempty"`
	// CRD generator to use for CRDs schemas.
	CRDGenerator crd.GeneratorType `json:"crdGenerator,omitempty"`
	// Paths to any CRDs to import as schemas, when relevant for the selected
	// crdGenerator. Can be file and/or URL paths. Glob patterns are supported.
	CRDPaths []string `json:"crdPaths,omitempty"`
}

Configuration that can be defined in `charts.k`, in addition to those specified in `helm.ChartBase`.

func (*ChartConfig) GenerateKCL

func (c *ChartConfig) GenerateKCL(w io.Writer) error

type ChartRepo

type ChartRepo struct {
	// Helm chart repository name for reference by `@name`.
	Name string `json:"name"`
	// Helm chart repository URL.
	URL string `json:"url"`

	// Basic authentication username environment variable.
	UsernameEnv string `json:"usernameEnv,omitempty"`
	// Basic authentication password environment variable.
	PasswordEnv string `json:"passwordEnv,omitempty"`

	// CA file path.
	CAPath string `json:"caPath,omitempty"`
	// TLS client certificate data path.
	TLSClientCertDataPath string `json:"tlsClientCertDataPath,omitempty"`
	// TLS client certificate key path.
	TLSClientCertKeyPath string `json:"tlsClientCertKeyPath,omitempty"`

	// Set to `True` to skip SSL certificate verification.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
	// Set to `True` to allow credentials to be used in chart dependencies defined
	// by charts in this repository.
	PassCredentials bool `json:"passCredentials,omitempty"`
}

Defines a Helm chart repository.

func (*ChartRepo) FromMap

func (c *ChartRepo) FromMap(m map[string]any) error

func (*ChartRepo) GenerateKCL

func (c *ChartRepo) GenerateKCL(w io.Writer) error

func (*ChartRepo) GetHelmRepo

func (c *ChartRepo) GetHelmRepo() (*helmrepo.RepoOpts, error)

func (*ChartRepo) GetSnakeCaseName

func (c *ChartRepo) GetSnakeCaseName() string

func (*ChartRepo) ToAutomation

func (c *ChartRepo) ToAutomation() kclautomation.Automation

func (*ChartRepo) Validate

func (c *ChartRepo) Validate() error

type ValueInferenceConfig

type ValueInferenceConfig struct {
	// Consider yaml which is commented out.
	UncommentYAMLBlocks bool `json:"uncommentYAMLBlocks,omitempty"`
	// Parse and use helm-docs comments.
	HelmDocsCompatibilityMode bool `json:"helmDocsCompatibilityMode,omitempty"`
	// Keep the helm-docs prefix (--) in the schema.
	KeepHelmDocsPrefix bool `json:"keepHelmDocsPrefix,omitempty"`
	// Keep the whole leading comment (default: cut at empty line).
	KeepFullComment bool `json:"keepFullComment,omitempty"`
	// Remove the global key from the schema.
	RemoveGlobal bool `json:"removeGlobal,omitempty"`
	// Skip auto-generation of Title.
	SkipTitle bool `json:"skipTitle,omitempty"`
	// Skip auto-generation of Description.
	SkipDescription bool `json:"skipDescription,omitempty"`
	// Skip auto-generation of Required.
	SkipRequired bool `json:"skipRequired,omitempty"`
	// Skip auto-generation of Default.
	SkipDefault bool `json:"skipDefault,omitempty"`
	// Skip auto-generation of AdditionalProperties.
	SkipAdditionalProperties bool `json:"skipAdditionalProperties,omitempty"`
}

ValueInferenceConfig defines configuration for value inference via dadav/helm-schema.

func (*ValueInferenceConfig) GenerateKCL

func (c *ValueInferenceConfig) GenerateKCL(w io.Writer) error

func (*ValueInferenceConfig) GetConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL