github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/runtime/oidc_values.go (about) 1 package runtime 2 3 import ( 4 "fmt" 5 "io/ioutil" 6 7 "github.com/kyma-project/kyma-environment-broker/internal" 8 "gopkg.in/yaml.v2" 9 ) 10 11 func ReadOIDCDefaultValuesFromYAML(yamlFilePath string) (internal.OIDCConfigDTO, error) { 12 var values internal.OIDCConfigDTO 13 yamlFile, err := ioutil.ReadFile(yamlFilePath) 14 if err != nil { 15 return internal.OIDCConfigDTO{}, fmt.Errorf("while reading YAML file with OIDC default values: %w", err) 16 } 17 18 err = yaml.Unmarshal(yamlFile, &values) 19 if err != nil { 20 return internal.OIDCConfigDTO{}, fmt.Errorf("while unmarshalling YAML file with OIDC default values: %w", err) 21 } 22 return values, nil 23 }