Skip to content

Commit

Permalink
panic on error
Browse files Browse the repository at this point in the history
  • Loading branch information
hofmeister committed Apr 9, 2024
1 parent d5638bc commit acf731f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions config/configfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
)

// ReadConfigFile reads the environment configuration file and returns the map
func ReadConfigFile() (map[string]string, error) {
func ReadConfigFile() map[string]string {
out := make(map[string]string)
kapetaConfigPath := os.Getenv("KAPETA_CONFIG_PATH")

if kapetaConfigPath == "" {
return out, nil
return out
}

// Open the JSON file
Expand All @@ -29,8 +29,8 @@ func ReadConfigFile() (map[string]string, error) {
err = decoder.Decode(&out)

if err != nil {
return out, err
panic(err)
}

return out, nil
return out
}
2 changes: 1 addition & 1 deletion providers/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type KubernetesConfigProvider struct {

// NewKubernetesConfigProvider creates a new instance of KubernetesConfigProvider
func NewKubernetesConfigProvider(blockRef, systemID, instanceID string, blockDefinition map[string]interface{}) ConfigProvider {
envConfig, _ := cfg.ReadConfigFile()
envConfig := cfg.ReadConfigFile()
return &KubernetesConfigProvider{
AbstractConfigProvider: AbstractConfigProvider{
BlockRef: blockRef,
Expand Down
2 changes: 1 addition & 1 deletion providers/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type LocalConfigProvider struct {

// NewLocalConfigProvider creates an instance of LocalConfigProvider
func NewLocalConfigProvider(blockRef, systemID, instanceID string, blockDefinition map[string]interface{}) *LocalConfigProvider {
envConfig, _ := cfg.ReadConfigFile()
envConfig := cfg.ReadConfigFile()

localProvider := &LocalConfigProvider{
AbstractConfigProvider: AbstractConfigProvider{
Expand Down

0 comments on commit acf731f

Please sign in to comment.