Skip to content

Commit

Permalink
[Fix] don't crash if values.yaml or Chart.yaml is not found
Browse files Browse the repository at this point in the history
Instead the default values are used, this would be the same as if the
file was empty.

This makes it possible to use helm-ls for helmfile projects that don't
have a values.yaml file (mrjosh#27).
  • Loading branch information
qvalentin committed Jul 28, 2023
1 parent 61debb2 commit bbd9ceb
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ func (h *langHandler) handleInitialize(ctx context.Context, reply jsonrpc2.Repli
vals, err := chartutil.ReadValuesFile(vf)
if err != nil {
logger.Println("Error loading values.yaml file", err)
return err
}
h.values = vals

chartFile := filepath.Join(workspace_uri.Path, "Chart.yaml")
chartMetadata, err := chartutil.LoadChartfile(chartFile)
if err != nil {
logger.Println("Error loading Chart.yaml file", err)
return err
}
h.chartMetadata = *chartMetadata

Expand Down

0 comments on commit bbd9ceb

Please sign in to comment.