From 72be1ca1ed8a1426bd70a246defe3d3c59dae33b Mon Sep 17 00:00:00 2001 From: Maksim Nabokikh Date: Mon, 5 Aug 2024 23:20:12 +0200 Subject: [PATCH] Do not fail on path resolution for default config --- internal/cmd/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 683c78dd9..0630001b8 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -77,7 +77,10 @@ func readConfigFile(ctx context.Context, cmd *cobra.Command) (*gomplate.Config, // we only support loading configs from the local filesystem for now fsys, err := datafs.FSysForPath(ctx, cfgFile) if err != nil { - return nil, fmt.Errorf("fsys for path %v: %w", cfgFile, err) + if configRequired { + return nil, fmt.Errorf("fsys for path %v: %w", cfgFile, err) + } + return nil, nil } f, err := fsys.Open(cfgFile)