From ee1bd9e0900b0c61e6121cbcbdece1c9099a9f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Tue, 22 Jan 2019 14:05:42 +0100 Subject: [PATCH] Only require validation configs when validation is enabled (#87) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Reinhard Nägele --- pkg/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 9229739..c866c27 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -108,7 +108,7 @@ func LoadConfiguration(cfgFile string, cmd *cobra.Command, bindFlagsFunc ...func if chartYamlSchemaPath == "" { var err error cfgFile, err = findConfigFile("chart_schema.yaml") - if err != nil && isLint { + if err != nil && isLint && cfg.ValidateChartSchema { return nil, errors.New("'chart_schema.yaml' neither specified nor found in default locations") } cfg.ChartYamlSchema = cfgFile @@ -118,7 +118,7 @@ func LoadConfiguration(cfgFile string, cmd *cobra.Command, bindFlagsFunc ...func if lintConfPath == "" { var err error cfgFile, err = findConfigFile("lintconf.yaml") - if err != nil && isLint { + if err != nil && isLint && cfg.ValidateYaml { return nil, errors.New("'lintconf.yaml' neither specified nor found in default locations") } cfg.LintConf = cfgFile