<#7464 fix: populate LogContext from live JobSet p...
# flyte-github
a
#7464 fix: populate LogContext from live JobSet pods for clustered tasks Pull request opened by AdilFayyaz Why are the changes needed? The clustered (JobSet) plugin only emitted templated log URLs synthesized from predicted pod names, which requires a pod-log template to be configured and breaks when real pod names carry the Job-assigned random suffix. The console needs a structured LogContext to fetch logs natively regardless of log-template config. What changes were proposed in this pull request? • Add getLogContext, which lists a JobSet's live child pods (via the jobset.sigs.k8s.io/jobset-name label) and builds a core.LogContext from the real pods using flytek8s.BuildPodLogContext. • Identify the primary (rank-0) pod by name prefix and exclude Pending pods that have no logs/container IDs yet; best-effort — returns nil on list error or when no pods are ready, falling back to the existing templated Logs path. • Wire LogContext into TaskInfo in GetTaskPhase. • Refactor test helper dummyPluginCtx to accept a client.Reader and add emptyK8sReader for tests that don't inspect pods. How was this patch tested? • go test ./flyteplugins/go/tasks/plugins/k8s/clustered/... • New TestGetTaskPhase_LogContext verifies a running JobSet with live worker pods produces a LogContext where the rank-0 pod is marked primary (matched despite its random suffix) and Pending pods are excluded. • Existing phase tests updated to pass an explicit K8sReader and continue to pass. Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Stack If you do use
git town
to manage PR Stacks, the stack relevant to this PR will show below. Otherwise, you can ignore this section. Docs link flyteorg/flyte