Skip to content

Commit

Permalink
Merge pull request #17 from orbatschow/fix/path-handling
Browse files Browse the repository at this point in the history
fix: update documentation and dump better error on config read
  • Loading branch information
orbatschow authored Apr 24, 2023
2 parents 3972228 + 4ff7437 commit f687aa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions example/kontext.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"fmt"
"os"
"path/filepath"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f687aa2

Please sign in to comment.