Skip to content

Commit

Permalink
fix: prevent err EOF if venomrc is all commented or empty (ovh#678)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and Begi committed Jun 15, 2023
1 parent 9f35ba2 commit cb5d182
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/venom/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ type ConfigFileData struct {
// Configuration file overrides the environment variables.
func initFromReaderConfigFile(reader io.Reader) error {
btes, err := io.ReadAll(reader)
if err != nil {

if err != nil && err != io.EOF {
return err
}

var configFileData ConfigFileData
if err := yaml.Unmarshal(btes, &configFileData); err != nil {
if err := yaml.Unmarshal(btes, &configFileData); err != nil && err != io.EOF {
return err
}

Expand Down

0 comments on commit cb5d182

Please sign in to comment.