Repository navigation
Honor container registries in published Kubernetes charts - #21121
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4112a489-7890-4a18-a965-664f81b553ea
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21121Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21121" |
Tests selector5 / 99 PR test projects · 2 PR jobs, from 26 changed files. Selected PR test projects (5 / 99)
Selected PR jobs (2)
How these were chosen — grouped by what changed🔧 📦 affected project 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟡 Changes recommended
Eager image-push callbacks can abort publication when their inputs are available only during deployment.
1 open issue
What changed in this PR
Addresses #14011 by including configured container registries in published Kubernetes chart image defaults.
Changes:
- Resolves publish-safe registry values using existing image naming rules.
- Adds regression tests and snapshots for registry selection, customization, and deferred inputs.
- Documents publication versus deployment resolution.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesContainerRegistryParameterDefaults.verified.yaml | Parameter-default image snapshot. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesContainerRegistryForDockerfileWithoutChangingPrebuiltImages#02.verified.yaml | Unchanged prebuilt image. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesContainerRegistryForDockerfileWithoutChangingPrebuiltImages#01.verified.yaml | Dockerfile deployment template. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesContainerRegistryForDockerfileWithoutChangingPrebuiltImages#00.verified.yaml | Qualified Dockerfile image. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=True_customizeImage=True#01.verified.yaml | Customized-image deployment template. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=True_customizeImage=True#00.verified.yaml | Custom image name and tag. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=True_customizeImage=False#01.verified.yaml | Explicit-registry deployment template. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=True_customizeImage=False#00.verified.yaml | Explicit-registry image value. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=False_customizeImage=False#01.verified.yaml | Default-registry deployment template. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishUsesConfiguredContainerRegistry_explicitRegistry=False_customizeImage=False#00.verified.yaml | Default-registry image value. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersSecretContainerRegistryDefaults.verified.yaml | Secret-default placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersMissingContainerRegistryParameters_repositoryParameter=True.verified.yaml | Missing-repository placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersMissingContainerRegistryParameters_repositoryParameter=False.verified.yaml | Missing-endpoint placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=True_secret=True#01.verified.yaml | Secret repository deployment resolution. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=True_secret=True#00.verified.yaml | Secret repository publication placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=True_secret=False#01.verified.yaml | Repository parameter deployment resolution. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=True_secret=False#00.verified.yaml | Repository parameter publication placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=False_secret=True#01.verified.yaml | Secret endpoint deployment resolution. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=False_secret=True#00.verified.yaml | Secret endpoint publication placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=False_secret=False#01.verified.yaml | Endpoint parameter deployment resolution. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryParameters_repositoryParameter=False_secret=False#00.verified.yaml | Endpoint parameter publication placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryOutputs_repositoryOutput=True.verified.yaml | Deferred repository-output placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/Snapshots/KubernetesPublisherTests.PublishDefersContainerRegistryOutputs_repositoryOutput=False.verified.yaml | Deferred endpoint-output placeholder. |
| tests/Aspire.Hosting.Kubernetes.Tests/KubernetesPublisherTests.cs | Registry publication regression coverage. |
| src/Aspire.Hosting.Kubernetes/README.md | Explains registry resolution and overrides. |
| src/Aspire.Hosting.Kubernetes/KubernetesPublishingContext.cs | Resolves publish-time image defaults. |
| src/Aspire.Hosting.Kubernetes/Deployment/HelmDeploymentEngine.cs | Updates deployment-resolution comments only. |
Review effort: Balanced
|
🚀 Deployment tests starting on PR #21121... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
Pull request created: #1935
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1935 targeting Added a "Container registries and published images" section to Note This draft PR needs human review before merging. |
…rts (#1935) Documents changes from microsoft/aspire#21121 by ``@davidfowl-unknown`` **Target branch:** Targeting `release/17.0` based on the source PR milestone `17.0` (`exact_match`). ## Why The source PR makes `aspire publish` write registry-qualified image values (for example `registry.example.com/apps/api:latest`) into published Kubernetes Helm charts. Previously the value was `api:latest`. Resolution of deferred registry inputs happens at deploy time. The docs didn't cover this. Triggered signals: `integration_readme_changed`, `pr_body_has_user_facing_section`, `pr_body_has_cli_flag_mention`. ## Changes Updated an existing page: - `src/frontend/src/content/docs/deployment/kubernetes.mdx`: added a "Container registries and published images" section with C# and TypeScript examples, the published `values.yaml` result, and publish-time vs deploy-time resolution. > Generated by [PR Documentation Check](https://github.com/microsoft/aspire/actions/runs/39547952513) for #21121 · copilot · auto · 32.9 AIC · ⌖ 1.17 AIC · ⊞ 20.4K · [◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests) <!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot, model: auto, id: 39547952513, workflow_id: pr-docs-check, run: https://github.com/microsoft/aspire/actions/runs/39547952513 --> <!-- gh-aw-workflow-id: pr-docs-check --> <!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check -->

Description
Published Kubernetes charts currently use
<resource>:latestfor buildable images even when a container registry is configured. Deploying those charts directly with Helm can therefore fail to pull the intended image.Resolve registry-qualified image defaults during publication when the registry endpoint and repository are literal values or non-secret parameters with defaults. Reuse
ContainerImageReferenceso repository prefixes, explicit registry selection, and custom image push names/tags follow the existing deployment naming rules. Preserve deferred registry inputs for deployment-time resolution and leave prebuilt container images unchanged.Add publisher snapshots and regression coverage for explicit/default registries, custom image names/tags, parameter defaults, missing and secret parameters, deferred outputs, Dockerfile-backed resources, and deployment-time overrides. Update the Kubernetes README to explain publication versus deployment resolution. No new dependencies or public APIs.
Fixes #14011
User-facing usage
C# AppHost:
TypeScript AppHost:
Running
aspire publishnow produces this image value instead ofapi:latest:Registry outputs that require provisioning remain deferred. When deploying the published chart outside
aspire deploy, supply those deferred image values to Helm.Validation
The original regression was reproduced locally before the fix: expected
registry.example.com/apps/api:latest, actualapi:latest.Passed: 170 tests, with reviewed generated snapshots, at head
15321d211d6614ec5c72b61f4750b480af88453f:Passed: four fresh-AppHost publishing scenarios on macOS ARM64 using the exact-head PR CLI and packages, version
17.0.0-pr.21121.g15321d21, from CI artifacts. Each scenario generated charts and passed complete structured assertions on image parameters and Helm-rendered workload images:Commands run for each scenario after creating a fresh
aspire-emptyC# AppHost from the PR hive, adding the matching Kubernetes integration, and creating a net10.0 API project:All commands passed. The missing-input scenario emitted the expected existing parameter-processing warning, then published successfully with the image placeholder retained. No live Kubernetes deployment or registry push was performed. Overall CI was still running when local validation completed.
Checklist
<remarks />and<code />elements on your triple slash comments?