fn framework support for legacy kustomize plugin io

This commit is contained in:
Phillip Wittrock
2021-02-17 09:19:02 -08:00
parent 99e82890e1
commit f7d13ade35

View File

@@ -130,6 +130,15 @@ func (r *ResourceList) defaultReadWriter() *kio.ByteReadWriter {
// Read reads the ResourceList
func (r *ResourceList) Read() error {
// legacy kustomize plugin input style
legacyPlugin := os.Getenv("KUSTOMIZE_PLUGIN_CONFIG_STRING")
if legacyPlugin != "" && r.FunctionConfig != nil {
err := yaml.Unmarshal([]byte(legacyPlugin), r.FunctionConfig)
if err != nil {
return err
}
}
// parse the inputs from the args
var readStdinStandalone bool
if len(r.Args) > 0 && !r.DisableStandalone {