charts

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencyCacheFolder = ".helm_ls_cache"

Functions

func IsDependencyFile added in v0.1.0

func IsDependencyFile(d PossibleDependencyFile) bool

func SyncToDisk added in v0.1.0

func SyncToDisk(d PossibleDependencyFile)

SyncToDisk writes the content of the document to disk if it is a dependency file. If it is a dependency file, it was read from a archive, so we need to write it back, to be able to open it in a editor when using go-to-definition or go-to-reference.

Types

type Chart

type Chart struct {
	ValuesFiles   *ValuesFiles
	ChartMetadata *ChartMetadata
	RootURI       uri.URI
	ParentChart   ParentChart
	HelmChart     *chart.Chart
}

func NewChart

func NewChart(rootURI uri.URI, valuesFilesConfig util.ValuesFilesConfig) *Chart

func NewChartFromHelmChart added in v0.1.0

func NewChartFromHelmChart(helmChart *chart.Chart, rootURI uri.URI) *Chart

func (*Chart) GetDependeciesTemplates added in v0.1.0

func (c *Chart) GetDependeciesTemplates() []*DependencyTemplateFile

func (*Chart) GetDependecyURI added in v0.1.0

func (c *Chart) GetDependecyURI(dependencyName string) uri.URI

func (*Chart) GetMetadataLocation added in v0.1.0

func (c *Chart) GetMetadataLocation(templateContext []string) (lsp.Location, error)

func (*Chart) GetScopedValuesFileDependencies added in v0.3.0

func (c *Chart) GetScopedValuesFileDependencies(chartStore *ChartStore) []*ScopedValuesFiles

func (*Chart) GetScopedValuesFileParents added in v0.3.0

func (c *Chart) GetScopedValuesFileParents(chartStore *ChartStore) []*ScopedValuesFiles

func (*Chart) GetScopedValuesFiles added in v0.3.0

func (c *Chart) GetScopedValuesFiles(chartStore *ChartStore) []*ScopedValuesFiles

For a given chart, return all values files return values files of parents if they contain values matching the current chartname or global values

return values files of dependencies with the shifted scope e.g. a subchart called subchart should be returned with the scope subchart (nested subcharts should have the scope subchart/subchart)

func (*Chart) Name added in v0.3.0

func (c *Chart) Name() string

func (*Chart) NewDependencyTemplateFile added in v0.1.0

func (c *Chart) NewDependencyTemplateFile(chartName string, file *chart.File) *DependencyTemplateFile

func (*Chart) ResolveValueFiles

func (c *Chart) ResolveValueFiles(query []string, chartStore *ChartStore) (result []*QueriedValuesFiles)

ResolveValueFiles returns a list of all values files in the chart and all parent and dependency charts with the adjusted query that match a given query a query starting with "global" returns all charts a query starting with "subchartName" will return the subchart if it is named "subchartName"

type ChartMetadata

type ChartMetadata struct {
	YamlNode yaml.Node
	Metadata chart.Metadata
	URI      uri.URI
}

func NewChartMetadata

func NewChartMetadata(rootURI uri.URI) *ChartMetadata

func NewChartMetadataForDependencyChart added in v0.1.0

func NewChartMetadataForDependencyChart(metadata *chart.Metadata, URI uri.URI) *ChartMetadata

Create a new ChartMetadata for a dependency chart, omitting the YamlNode since this is likely not required for dependency charts

type ChartStore

type ChartStore struct {
	Charts  map[uri.URI]*Chart
	RootURI uri.URI
	// contains filtered or unexported fields
}

func NewChartStore

func NewChartStore(rootURI uri.URI, newChart func(uri.URI, util.ValuesFilesConfig) *Chart, addChartCallback func(chart *Chart)) *ChartStore

func (*ChartStore) AddChart added in v0.1.0

func (s *ChartStore) AddChart(chart *Chart)

AddChart adds a new chart to the store and loads its dependencies

func (*ChartStore) GetChartForDoc

func (s *ChartStore) GetChartForDoc(uri lsp.DocumentURI) (*Chart, error)

func (*ChartStore) GetChartForURI

func (s *ChartStore) GetChartForURI(fileURI uri.URI) (*Chart, error)

func (*ChartStore) GetChartOrParentForDoc added in v0.0.14

func (s *ChartStore) GetChartOrParentForDoc(uri lsp.DocumentURI) (*Chart, error)

func (*ChartStore) ReloadValuesFile

func (s *ChartStore) ReloadValuesFile(file uri.URI)

func (*ChartStore) SetRootURI added in v0.3.0

func (s *ChartStore) SetRootURI(rootURI uri.URI)

func (*ChartStore) SetValuesFilesConfig

func (s *ChartStore) SetValuesFilesConfig(valuesFilesConfig util.ValuesFilesConfig)

type DependencyTemplateFile added in v0.1.0

type DependencyTemplateFile struct {
	Content []byte
	Path    string
}

type ErrChartNotFound

type ErrChartNotFound struct {
	URI lsp.DocumentURI
}

func (ErrChartNotFound) Error

func (e ErrChartNotFound) Error() string

type ParentChart

type ParentChart struct {
	ParentChartURI uri.URI
	HasParent      bool
}

func (*ParentChart) GetParentChart

func (p *ParentChart) GetParentChart(chartStore *ChartStore) *Chart

func (*ParentChart) GetParentChartRecursive added in v0.0.14

func (p *ParentChart) GetParentChartRecursive(chartStore *ChartStore) *Chart

type PossibleDependencyFile added in v0.1.0

type PossibleDependencyFile interface {
	GetContent() []byte
	GetPath() string
}

type QueriedValuesFiles

type QueriedValuesFiles struct {
	Selector    []string
	ValuesFiles *ValuesFiles
}

type ScopedValuesFiles added in v0.3.0

type ScopedValuesFiles struct {
	// Scope defines a scope of the values files within the current chart.
	// Scope is used for parent charts, it indicates the scope in the parents charts values where the child chart values are relevant
	Scope []string
	// SubScope defines a scope within the values files. "global" is always an implicit subscope.
	// SubScope is used for dependency charts to indicate the scope of the parents values that is relevant for the current chart
	SubScope    []string
	ValuesFiles *ValuesFiles
	Chart       *Chart
}

type ValuesFile

type ValuesFile struct {
	Values    chartutil.Values
	ValueNode yaml.Node
	URI       uri.URI
	// contains filtered or unexported fields
}

func NewValuesFileFromContent added in v0.1.0

func NewValuesFileFromContent(uri uri.URI, data []byte) *ValuesFile

func NewValuesFileFromPath added in v0.1.0

func NewValuesFileFromPath(filePath string) *ValuesFile

func (*ValuesFile) GetContent added in v0.1.0

func (v *ValuesFile) GetContent() []byte

GetContent implements PossibleDependencyFile.

func (*ValuesFile) GetPath added in v0.1.0

func (v *ValuesFile) GetPath() string

GetPath implements PossibleDependencyFile.

func (*ValuesFile) Reload

func (v *ValuesFile) Reload()

type ValuesFiles

type ValuesFiles struct {
	MainValuesFile        *ValuesFile
	OverlayValuesFile     *ValuesFile
	AdditionalValuesFiles []*ValuesFile
}

func NewValuesFiles

func NewValuesFiles(rootURI uri.URI, mainValuesFileName string, lintOverlayValuesFile string, additionalValuesFilesGlob string) *ValuesFiles

func (*ValuesFiles) AllValuesFiles

func (v *ValuesFiles) AllValuesFiles() []*ValuesFile

func (*ValuesFiles) GetPositionsForValue

func (v *ValuesFiles) GetPositionsForValue(query []string) []lsp.Location

Jump to

Keyboard shortcuts

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