Skip to content

Commit

Permalink
make test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Jan 10, 2023
1 parent 7e77346 commit dc910f9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions pkg/commands/options/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,19 @@ func (bo *BuildOptions) LoadConfig() error {
if err != nil {
return fmt.Errorf("error looking for config file: %w", err)
}
if file.IsDir() {
v.AddConfigPath(override) // add this dir to the set of places we'll look for .ko.yaml
} else if file.Mode().IsRegular() {
v.SetConfigFile(override) // only look at exactly this file path
if file.Mode().IsRegular() {
v.SetConfigFile(override)
} else if file.IsDir() {
path := filepath.Join(override, ".ko.yaml")
file, err = os.Stat(path)
if err != nil {
return fmt.Errorf("error looking for config file: %w", err)
}
if file.Mode().IsRegular() {
v.SetConfigFile(path)
} else {
return fmt.Errorf("config file %s is not a regular file", path)
}
} else {
return fmt.Errorf("config file %s is not a regular file", override)
}
Expand Down

0 comments on commit dc910f9

Please sign in to comment.