Skip to content

Commit 3c87ff3

Browse files
jtherinremyleone
andauthored
fix: cloud-init param for instance was not working (#1943)
Co-authored-by: Rémy Léone <[email protected]>
1 parent cefe622 commit 3c87ff3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/core/arg_file_content.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ func loadArgsFileContent(cmd *Command, cmdArgs interface{}) error {
4848
}
4949
v.SetString(string(content))
5050
}
51+
case string:
52+
if strings.HasPrefix(i, "@") {
53+
content, err := ioutil.ReadFile(i[1:])
54+
if err != nil {
55+
return fmt.Errorf("could not open requested file: %s", err)
56+
}
57+
v.SetString(string(content))
58+
}
59+
default:
60+
panic(fmt.Errorf("unsupported field type: %T", v.Interface()))
5161
}
5262
}
5363
}

0 commit comments

Comments
 (0)