PublishAsDockerFile callback drops generated container args in Helm deployment
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
- [x] I have searched the existing issues
### Describe the bug
When publishing a single Python resource to Helm using `aspire publish -o publish`, container startup args are generated as expected.
If I add an empty `PublishAsDockerFile` callback, the Dockerfile is still generated correctly, but the `args` block disappears from `publish/templates/app/deployment.yaml`.
This looks like a regression/side-effect because only the callback was added and all other deployment content remains effectively unchanged.
### Expected Behavior
Adding an empty `PublishAsDockerFile` callback should not change generated container runtime args in the Helm deployment manifest.
I expect this block to still be present:
```yaml
args:
- "main:app"
- "--host"
- "0.0.0.0"
- "--port"
- "8000"
```
### Steps To Reproduce
Minimal AppHost:
```csharp
var builder = Aspire.Hosting.DistributedApplication.CreateBuilder(args);
builder.AddUvicornApp("app", "./app", "main:app")
.WithUv()
.PublishAsDockerFile(configure =>
{
});
builder.AddKubernetesEnvironment("k8s");
builder.Build().Run();
```
1. Run `aspire publish -o publish-with-callback` with the AppHost above.
2. Inspect `publish-with-callback/templates/app/deployment.yaml`.
3. Observe there is no `args` section under the `app` container.
4. Remove only `.PublishAsDockerFile(configure => { })` from the chain.
5. Run `aspire publish -o publish-no-callback`.
6. Inspect `publish-no-callback/templates/app/deployment.yaml`.
7. Observe `args` is present:
- `main:app`
- `--host`
- `0.0.0.0`
- `--port`
- `8000`
Observed in controlled local repro:
- `WITH_CALLBACK_ARGS=False`
- `WITHOUT_CALLBACK_ARGS=True`
### Exceptions (if any)
No exception is thrown.
### Aspire doctor output
```text
Aspire Environment Check
========================
.NET SDK
✅ .NET 11.0.100-preview.3.26207.106 installed (x64)
Container Runtime
⚠️ Podman: installed but not running ← active
Start Podman service: sudo systemctl start podman
Environment
✅ HTTPS development certificate is trusted
Summary: 2 passed, 1 warnings, 0 failed
For detailed prerequisites: https://aka.ms/aspire-prerequisites
```
### Anything else?
- .NET SDK: `11.0.100-preview.3.26207.106`
- Aspire CLI: `13.3.0+4517e4a1ffb7f00a4c0e66882c2db952d637c0cc`
- AppHost SDK: `Aspire.AppHost.Sdk/13.3.0`
- Package refs:
- `Aspire.Hosting.Kubernetes` `13.3.0-preview.1.26256.5`
- `Aspire.Hosting.Python` `13.3.0`
- OS: Windows
- Tooling: VS Code + CLI
AI disclosure: this issue report was prepared with assistance from GitHub Copilot (GPT-5.3-Codex), and all technical observations were verified locally.
Contributor guide
Assessment
This issue has not been assessed yet.