From 56c377142cc6e17e095ccec28aadf7bd0a0604f3 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Wed, 18 Dec 2024 08:14:57 -0600 Subject: [PATCH 1/3] Pass Actor metadata through ArrayNode ExternalResourceInfo (#591) * pass CustomInfo through ArrayNode event recorder Signed-off-by: Daniel Rammer * actually doing it Signed-off-by: Daniel Rammer * correctly passing custom Signed-off-by: Daniel Rammer --------- Signed-off-by: Daniel Rammer --- .../pkg/controller/nodes/array/event_recorder.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index 8d14bd1d43..1d54b6765b 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -136,14 +136,21 @@ func (e *externalResourcesEventRecorder) process(ctx context.Context, nCtx inter log.Name = fmt.Sprintf("%s-%d", log.GetName(), index) } - e.externalResources = append(e.externalResources, &event.ExternalResourceInfo{ + externalResourceInfo := events.ExternalResourceInfo{ ExternalId: externalResourceID, Index: uint32(index), // #nosec G115 Logs: taskExecutionEvent.GetLogs(), RetryAttempt: retryAttempt, Phase: taskExecutionEvent.GetPhase(), CacheStatus: cacheStatus, - }) + CustomInfo: taskExecutionEvent.CustomInfo, + } + + if taskExecutionEvent.GetMetadata() != nil && len(taskExecutionEvent.GetMetadata().ExternalResources) == 1 { + externalResourceInfo.CustomInfo = taskExecutionEvent.GetMetadata().ExternalResources[0].CustomInfo + } + + e.externalResources = append(e.externalResources, &externalResourceInfo) } // clear nodeEvents and taskEvents From 9ca3acf8a28879872336d9458b90443402635210 Mon Sep 17 00:00:00 2001 From: Daniel Rammer Date: Wed, 18 Dec 2024 11:26:07 -0600 Subject: [PATCH 2/3] events -> event Signed-off-by: Daniel Rammer --- flytepropeller/pkg/controller/nodes/array/event_recorder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index 1d54b6765b..f48ee36bb4 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -136,7 +136,7 @@ func (e *externalResourcesEventRecorder) process(ctx context.Context, nCtx inter log.Name = fmt.Sprintf("%s-%d", log.GetName(), index) } - externalResourceInfo := events.ExternalResourceInfo{ + externalResourceInfo := event.ExternalResourceInfo{ ExternalId: externalResourceID, Index: uint32(index), // #nosec G115 Logs: taskExecutionEvent.GetLogs(), From d653b15f25d4ae2c7436fcaaf3b7a110d08f4b52 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Thu, 19 Dec 2024 14:14:35 -0500 Subject: [PATCH 3/3] Run make -C flytepropelelr lint-fix Signed-off-by: Eduardo Apolinario --- flytepropeller/pkg/controller/nodes/array/event_recorder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index f48ee36bb4..d9feafe950 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -143,11 +143,11 @@ func (e *externalResourcesEventRecorder) process(ctx context.Context, nCtx inter RetryAttempt: retryAttempt, Phase: taskExecutionEvent.GetPhase(), CacheStatus: cacheStatus, - CustomInfo: taskExecutionEvent.CustomInfo, + CustomInfo: taskExecutionEvent.GetCustomInfo(), } - if taskExecutionEvent.GetMetadata() != nil && len(taskExecutionEvent.GetMetadata().ExternalResources) == 1 { - externalResourceInfo.CustomInfo = taskExecutionEvent.GetMetadata().ExternalResources[0].CustomInfo + if taskExecutionEvent.GetMetadata() != nil && len(taskExecutionEvent.GetMetadata().GetExternalResources()) == 1 { + externalResourceInfo.CustomInfo = taskExecutionEvent.GetMetadata().GetExternalResources()[0].GetCustomInfo() } e.externalResources = append(e.externalResources, &externalResourceInfo)