Skip to content

feat(app): implement K8sPod payload support in buildPodSpec#7340

Open
andreahlert wants to merge 1 commit into
flyteorg:mainfrom
andreahlert:feat/k8spod-app-payload
Open

feat(app): implement K8sPod payload support in buildPodSpec#7340
andreahlert wants to merge 1 commit into
flyteorg:mainfrom
andreahlert:feat/k8spod-app-payload

Conversation

@andreahlert
Copy link
Copy Markdown

closes #7328

the Spec_Pod case in buildPodSpec was just a stub throwing an error. wired it up to actually deserialize the k8s pod spec using UnmarshalStructToObj from flytestdlib.

pod spec already carries its own containers, resources, envs, ports — all that stuff comes through the deserialization. no manual field mapping needed.

EnableServiceLinks defaults to false if not set, otherwise respects what the user defined.

added tests for the happy path, nil spec, invalid json, and no payload. go test ./app/internal/k8s passes — the pre-existing KserviceToStatus failure is unrelated.

Implements the Spec_Pod case in app/internal/k8s/app_client.go so that
K8sPod app payloads are fully deserialized into corev1.PodSpec.

- Uses flytestdlib/utils.UnmarshalStructToObj to convert the structpb.Struct
  pod spec into a corev1.PodSpec.
- Validates that PodSpec is present before attempting unmarshal.
- Defaults EnableServiceLinks to false when not specified by the user.
- Adds unit tests covering container, pod, nil pod spec, invalid JSON,
  and no payload scenarios.

Resolves flyteorg#7328

Signed-off-by: André Ahlert <andre@aex.partners>
@github-actions github-actions Bot added the flyte2 label May 5, 2026
Copy link
Copy Markdown
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Did you test it in the devbox? Try deploying an app with a podTemplate and see if it works

@andreahlert
Copy link
Copy Markdown
Author

Thanks for your contribution. Did you test it in the devbox? Try deploying an app with a podTemplate and see if it works

Yes, I did :)

Deployed a test with a pod_template adding busybox sidecar to the primary container. Both containers came up Running and the sidecar executed its custom command, so the K8sPod path looks good. Lmk if you wanted a different test scenario, but lgtm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for K8sPod app payload in app_client.go

2 participants