From 4ff7437ecfa0635006f27068a19b5218582b091e Mon Sep 17 00:00:00 2001 From: orbatschow Date: Mon, 24 Apr 2023 22:08:03 +0200 Subject: [PATCH] fix: update documentation and dump better error on config read --- example/kontext.yaml | 3 +-- pkg/config/config.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/example/kontext.yaml b/example/kontext.yaml index 2dbd27f..d4df228 100644 --- a/example/kontext.yaml +++ b/example/kontext.yaml @@ -1,6 +1,5 @@ # global configuration options global: - # target kubeconfig file for kontext, all sources will be merged into this file # will be replaced each time a group/context is set # see .backup for backup/restore options @@ -18,7 +17,7 @@ global: # state configuration options state: # override the default state file path - path: $HOME/.local/state/kontext/state.json + file: $HOME/.local/state/kontext/state.json # backup configuration settings # backup targets: diff --git a/pkg/config/config.go b/pkg/config/config.go index 592c720..4be837e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1,7 +1,6 @@ package config import ( - "fmt" "os" "path/filepath" @@ -102,7 +101,7 @@ func (r *Client) Read() (*Config, error) { // load configuration with into koanf if err := instance.Load(file.Provider(r.File), yaml.Parser()); err != nil { - return nil, fmt.Errorf("failed to load config file, expected file at '%s'", r.File) + return nil, err } // set default values