Skip to content

Commit

Permalink
more edits
Browse files Browse the repository at this point in the history
  • Loading branch information
willfairwinds committed Jul 30, 2019
1 parent e4fe5ab commit 79b0a00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,17 @@ type SecurityCapabilityLists struct {

// ParseFile parses config from a file.
func ParseFile(path string) (Configuration, error) {
var err error
var rawBytes []byte
var err error
configBox := packr.New("Config", "../../examples")
if path == "" {
rawBytes, err = configBox.Find("config.yaml")
} else if strings.HasPrefix(path, "https://") || strings.HasPrefix(path, "http://") {
//path is a url
response, err := http.Get(path)
response, err2 := http.Get(path)
if err2 != nil {
return Configuration{}, err2
}
rawBytes, err = ioutil.ReadAll(response.Body)
} else {
//path is local
Expand Down

0 comments on commit 79b0a00

Please sign in to comment.