Skip to content

Commit

Permalink
fix: Skip EOF error when default empty yaml file
Browse files Browse the repository at this point in the history
Related to milvus-io#37404

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Nov 5, 2024
1 parent b83b376 commit 6ab50f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/config/file_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package config
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -146,7 +147,7 @@ func (fs *FileSource) loadFromFile() error {

var node yaml.Node
decoder := yaml.NewDecoder(bytes.NewReader(data))
if err := decoder.Decode(&node); err != nil {
if err := decoder.Decode(&node); err != nil && !errors.Is(err, io.EOF) {
return errors.Wrap(err, "YAML unmarshal failed: "+configFile)
}

Expand Down

0 comments on commit 6ab50f1

Please sign in to comment.