From 8b22f47c63bddb406943b1a6d62014cb7c8f8fc7 Mon Sep 17 00:00:00 2001 From: Jeremy THERIN Date: Wed, 23 Jun 2021 16:10:56 +0200 Subject: [PATCH] fix: cloud-init param for instance was not working --- internal/core/arg_file_content.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/core/arg_file_content.go b/internal/core/arg_file_content.go index 3bd3657f3a..de8e288094 100644 --- a/internal/core/arg_file_content.go +++ b/internal/core/arg_file_content.go @@ -48,6 +48,16 @@ func loadArgsFileContent(cmd *Command, cmdArgs interface{}) error { } v.SetString(string(content)) } + case string: + if strings.HasPrefix(i, "@") { + content, err := ioutil.ReadFile(i[1:]) + if err != nil { + return fmt.Errorf("could not open requested file: %s", err) + } + v.SetString(string(content)) + } + default: + panic(fmt.Errorf("unsupported field type: %T", v.Interface())) } } }