Skip to content

Commit

Permalink
deprecate file types other than yaml and json
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
  • Loading branch information
AustinAbro321 committed Feb 19, 2025
1 parent 1569ba1 commit 56e636f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 68 deletions.
48 changes: 0 additions & 48 deletions examples/config-file/zarf-config.ini

This file was deleted.

20 changes: 0 additions & 20 deletions examples/config-file/zarf-config.json

This file was deleted.

6 changes: 6 additions & 0 deletions src/cmd/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"

"github.com/zarf-dev/zarf/src/pkg/logger"
Expand Down Expand Up @@ -190,6 +191,11 @@ func PrintViperConfigUsed(ctx context.Context) error {
// Zarf skips loading the config file for version and tool commands, this avoids output in those cases
if cfgFile := v.ConfigFileUsed(); cfgFile != "" {
l.Info("using config file", "location", cfgFile)
fileType := strings.TrimPrefix(filepath.Ext(cfgFile), ".")
fmt.Println("file type is", fileType)
if !(fileType == "yml" || fileType == "yaml" || fileType == "toml") {
l.Warn("configuration file types other than YAML and TOML are deprecated and will be removed in a future release", "fileType", fileType)
}
}
return nil
}
Expand Down

0 comments on commit 56e636f

Please sign in to comment.