This commit is contained in:
Bartal Læarsson
2025-03-02 21:42:39 +00:00
parent f4bb0329bc
commit 762eb94ee0
2 changed files with 33 additions and 12 deletions
+4 -3
View File
@@ -33,12 +33,14 @@ type Config struct {
func LoadDefaultConfig() (*Config, error) {
defaultsPath, err := config.GetAnsiblePath("defaults/kubernetes.yml")
if err != nil {
return nil, fmt.Errorf("failed to locate defaults file: %w", err)
return nil, fmt.Errorf("failed to locate defaults file: %w\n"+
"Please make sure you are running the command from within the repository and that the ansible/defaults/kubernetes.yml file exists", err)
}
data, err := os.ReadFile(defaultsPath)
if err != nil {
return nil, fmt.Errorf("failed to read defaults file: %w", err)
return nil, fmt.Errorf("failed to read defaults file at %s: %w\n"+
"Please check file permissions and that the repository is correctly cloned", defaultsPath, err)
}
config := &Config{}
@@ -256,4 +258,3 @@ func Cleanup() error {
return cmd.Run()
}