Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
for i := 0; i < maxDepth; i++ {
_, err := fs.Stat(path.Join(filepath, configFileName))
if err != nil {
// Check if user mispelled '.sops.yaml'
warnWrongConfigFileExtension(filepath)
filepath = path.Join(filepath, "..")
} else {
return path.Join(filepath, configFileName), nil
Expand All @@ -55,6 +57,14 @@
return "", fmt.Errorf("Config file not found")
}

func warnWrongConfigFileExtension(filepath string) {
_, err :=
fs.Stat(path.Join(filepath, ".sops.yml"))
if err == nil {
log.Printf("warning: Found unsupported '.sops.yml' config file. Rename it to '.sops.yaml' or use '--config .sops.yml' flag")

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test linux amd64 1.22

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test linux amd64 1.23

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test linux arm64 1.22

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test linux arm64 1.23

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test darwin amd64 1.22

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test darwin amd64 1.23

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test darwin arm64 1.22

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test darwin arm64 1.23

undefined: log

Check failure on line 64 in config/config.go

View workflow job for this annotation

GitHub Actions / Build and test windows amd64 1.22

undefined: log
}
}

type DotenvStoreConfig struct{}

type INIStoreConfig struct{}
Expand Down
Loading