From b0ba3fa125eb3bc175b3b062c74014f0a47b405c Mon Sep 17 00:00:00 2001 From: Amit Kumar Das Date: Thu, 13 Jul 2023 13:18:00 +0530 Subject: [PATCH] fix: fixed subscriber startTime issue (#4087) Signed-off-by: Amit Kumar Das --- chaoscenter/subscriber/pkg/events/chaosengine.go | 2 +- chaoscenter/subscriber/pkg/events/workflow.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chaoscenter/subscriber/pkg/events/chaosengine.go b/chaoscenter/subscriber/pkg/events/chaosengine.go index ede4b5e7eb8..acf9b476769 100644 --- a/chaoscenter/subscriber/pkg/events/chaosengine.go +++ b/chaoscenter/subscriber/pkg/events/chaosengine.go @@ -83,7 +83,7 @@ func chaosEventHandler(obj interface{}, eventType string, stream chan types.Work return } - if workflowObj.ObjectMeta.CreationTimestamp.Unix() < startTime { + if workflowObj.ObjectMeta.CreationTimestamp.UnixMilli() < startTime { return } diff --git a/chaoscenter/subscriber/pkg/events/workflow.go b/chaoscenter/subscriber/pkg/events/workflow.go index b534e4b3933..4036a925277 100644 --- a/chaoscenter/subscriber/pkg/events/workflow.go +++ b/chaoscenter/subscriber/pkg/events/workflow.go @@ -111,8 +111,8 @@ func WorkflowEventHandler(workflowObj *v1alpha1.Workflow, eventType string, star return types.WorkflowEvent{}, nil } - if workflowObj.ObjectMeta.CreationTimestamp.Unix() < startTime { - return types.WorkflowEvent{}, nil + if workflowObj.ObjectMeta.CreationTimestamp.UnixMilli() < startTime { + return types.WorkflowEvent{}, errors.New("startTime of subscriber is greater than experiment creation timestamp") } cfg, err := k8s.GetKubeConfig()