From c3416de3cb7d1aa6e86186b314bfa1e00a8af4c8 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Mon, 19 Sep 2022 17:10:06 +0200 Subject: [PATCH] fix for go1.16 and possible sigsev --- internal/pkg/api/util/util.go | 1 + internal/pkg/node/transformers.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/api/util/util.go b/internal/pkg/api/util/util.go index bf34ec92..093183ed 100644 --- a/internal/pkg/api/util/util.go +++ b/internal/pkg/api/util/util.go @@ -29,6 +29,7 @@ func ConfirmationPrompt(label string) (yes bool) { Simple check if the config can be written in case wwctl isn't run as root */ func CanWriteConfig() (canwrite *wwapiv1.CanWriteConfig) { + canwrite = new(wwapiv1.CanWriteConfig) err := syscall.Access(node.ConfigFile, syscall.O_RDWR) if err != nil { wwlog.Warn("Couldn't open %s:%s", node.ConfigFile, err) diff --git a/internal/pkg/node/transformers.go b/internal/pkg/node/transformers.go index 9b4501de..c8c679e1 100644 --- a/internal/pkg/node/transformers.go +++ b/internal/pkg/node/transformers.go @@ -512,7 +512,7 @@ func getYamlString(myType reflect.StructField, excludeList []string) (string, bo ymlStr += ": {string}" } else if myType.Type == reflect.TypeOf(map[string]string{}) { ymlStr += ": {key: value}" - } else if myType.Type.Kind() == reflect.Pointer { + } else if myType.Type.Kind() == reflect.Ptr { ymlStr += ":" } return ymlStr, true