<#7270 [Flyteconnector] Construct pod spec and ren...
# flyte-github
a
#7270 [Flyteconnector] Construct pod spec and render arguments Pull request opened by madiyar-wayve Tracking issue Closes: #7227. Why are the changes needed? The Flyte connector (and agent) webapi plugins don't build a K8s pod spec and render command arguments when the task template target is
K8sPod
instead of
Container
. As a result, agents executing
k8s_pod_task
workloads receive literal template placeholders like
{{.input}}
and
{{.outputPrefix}}
instead of resolved values, causing the task to fail. The plugin should construct the pod spec and render arguments for
K8sPod
targets, just like it already does for
Container
targets. What changes were proposed in this pull request? In the
Create
method of both
flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
and
.../connector/plugin.go
, handle the
K8sPod
target in addition to `Container`: • Cast
webapi.TaskExecutionContext
to
core.TaskExecutionContext
and call
flytek8s.ToK8sPodSpec(...)
to build a fully rendered pod spec. • Marshal the rendered
PodSpec
into a
structpb.Struct
, temporarily swap it onto
taskTemplate.GetK8SPod().PodSpec
for the
CreateTaskRequest
, and restore the original via
defer
(mirroring the existing container-args pattern). How was this patch tested? Added an end-to-end test
run a k8s_pod task with rendered template args
in both
agent/integration_test.go
and
connector/integration_test.go
. The test submits a
K8sPod
template with
{{.input}}
/
{{.outputPrefix}}
in container args and uses a
mock.MatchedBy
matcher on
CreateTask
to assert the received pod spec contains no
{{
placeholders; a fallback expectation fails the test if an unrendered request slips through. Labels • fixed — K8sPod targets now get their pod spec built and args rendered in the agent/connector webapi plugins. Setup process N/A Screenshots N/A Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. flyteorg/flyte