From bbd9ceb663089afc4da1b97d409928a7b4e7ebd3 Mon Sep 17 00:00:00 2001 From: qvalentin Date: Fri, 28 Jul 2023 17:33:16 +0200 Subject: [PATCH] [Fix] don't crash if values.yaml or Chart.yaml is not found 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 (https://github.com/mrjosh/helm-ls/issues/27). --- internal/handler/handler.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 205c8a68..48dd1a6d 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -88,7 +88,6 @@ 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 @@ -96,7 +95,6 @@ func (h *langHandler) handleInitialize(ctx context.Context, reply jsonrpc2.Repli chartMetadata, err := chartutil.LoadChartfile(chartFile) if err != nil { logger.Println("Error loading Chart.yaml file", err) - return err } h.chartMetadata = *chartMetadata