@@ -11,6 +11,7 @@ import (
11
11
initconstants "github.com/kubeshop/testkube/cmd/testworkflow-init/constants"
12
12
"github.com/kubeshop/testkube/cmd/testworkflow-init/instructions"
13
13
"github.com/kubeshop/testkube/pkg/api/v1/testkube"
14
+ "github.com/kubeshop/testkube/pkg/log"
14
15
"github.com/kubeshop/testkube/pkg/testworkflows/executionworker/controller/watchers"
15
16
"github.com/kubeshop/testkube/pkg/testworkflows/testworkflowconfig"
16
17
"github.com/kubeshop/testkube/pkg/testworkflows/testworkflowprocessor/stage"
@@ -44,7 +45,7 @@ type Controller interface {
44
45
Pause (ctx context.Context ) error
45
46
Resume (ctx context.Context ) error
46
47
Cleanup (ctx context.Context ) error
47
- Watch (ctx context.Context , disableFollow bool ) <- chan ChannelMessage [Notification ]
48
+ Watch (ctx context.Context , disableFollow , logAbortedDetails bool ) <- chan ChannelMessage [Notification ]
48
49
WatchLightweight (ctx context.Context ) <- chan LightweightNotification
49
50
Logs (ctx context.Context , follow bool ) io.Reader
50
51
NodeName () (string , error )
@@ -88,6 +89,7 @@ func New(parentCtx context.Context, clientSet kubernetes.Interface, namespace, i
88
89
89
90
// There was a job or pod for this execution, so we may only assume it is aborted
90
91
if ! watcher .State ().JobEvents ().FirstTimestamp ().IsZero () || ! watcher .State ().PodEvents ().FirstTimestamp ().IsZero () {
92
+ log .DefaultLogger .Errorw ("connecting to aborted execution" , "executionId" , watcher .State ().ResourceId (), "debug" , watcher .State ().Debug ())
91
93
return nil , ErrJobAborted
92
94
}
93
95
@@ -226,9 +228,10 @@ func (c *controller) EstimatedResult(parentCtx context.Context) (*testkube.TestW
226
228
return nil , ErrMissingEstimatedResult
227
229
}
228
230
229
- func (c * controller ) Watch (parentCtx context.Context , disableFollow bool ) <- chan ChannelMessage [Notification ] {
231
+ func (c * controller ) Watch (parentCtx context.Context , disableFollow bool , logAbortedDetails bool ) <- chan ChannelMessage [Notification ] {
230
232
ch , err := WatchInstrumentedPod (parentCtx , c .clientSet , c .signature , c .scheduledAt , c .watcher , WatchInstrumentedPodOptions {
231
- DisableFollow : disableFollow ,
233
+ DisableFollow : disableFollow ,
234
+ LogAbortedDetails : logAbortedDetails ,
232
235
})
233
236
if err != nil {
234
237
v := make (chan ChannelMessage [Notification ], 1 )
@@ -249,7 +252,7 @@ func (c *controller) WatchLightweight(parentCtx context.Context) <-chan Lightwei
249
252
ch := make (chan LightweightNotification )
250
253
go func () {
251
254
defer close (ch )
252
- for v := range c .Watch (parentCtx , false ) {
255
+ for v := range c .Watch (parentCtx , false , false ) {
253
256
if v .Error != nil {
254
257
ch <- LightweightNotification {Error : v .Error }
255
258
continue
0 commit comments