From f9fa18b8a17877324aba0f25fd027f5d26bc51cc Mon Sep 17 00:00:00 2001 From: Ondrej Smola Date: Mon, 21 Oct 2019 17:59:34 +0200 Subject: [PATCH] added namespace to create obj (#385) --- sensors/trigger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sensors/trigger.go b/sensors/trigger.go index 3efe83ae39..8137979cdc 100644 --- a/sensors/trigger.go +++ b/sensors/trigger.go @@ -19,6 +19,7 @@ package sensors import ( "encoding/json" "fmt" + "k8s.io/apimachinery/pkg/runtime/schema" "github.com/Knetic/govaluate" @@ -327,7 +328,7 @@ func (sec *sensorExecutionCtx) createResourceObject(trigger *v1alpha1.Trigger, o Resource: trigger.Template.Resource, }) - liveObj, err := dynamicResInterface.Create(obj, metav1.CreateOptions{}) + liveObj, err := dynamicResInterface.Namespace(obj.GetNamespace()).Create(obj, metav1.CreateOptions{}) if err != nil { return fmt.Errorf("failed to create resource object. err: %+v", err) }