From 4a1520b3c9093c760cc7257c93667cd4c6155031 Mon Sep 17 00:00:00 2001 From: Leonardo Grasso Date: Fri, 24 Apr 2020 11:17:58 +0200 Subject: [PATCH] fix(events/k8saudit): correct misplaced reader when loading YAMLs Signed-off-by: Leonardo Grasso --- events/k8saudit/yaml_loader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/k8saudit/yaml_loader.go b/events/k8saudit/yaml_loader.go index a6a67487..ccc52665 100644 --- a/events/k8saudit/yaml_loader.go +++ b/events/k8saudit/yaml_loader.go @@ -20,17 +20,17 @@ func init() { // The filename must be in the dash-case format, // so it will be converted to CamelCase and used as action's name. fileName := n + fileContent := b name := strcase.ToCamel(strings.TrimSuffix(fileName, filepath.Ext(fileName))) actionName := "k8saudit." + name - reader := bytes.NewReader(b) events.RegisterWithName(func(h events.Helper) error { count := 0 r := h.ResourceBuilder(). Unstructured(). // Schema(schema). // todo(leogr): do we need this? ContinueOnError(). - Stream(reader, fileName). + Stream(bytes.NewReader(fileContent), fileName). Flatten(). Do() if err := r.Err(); err != nil {