microsoft / microsoft/aspire

Repin RadiusDeployTests KIND container image off the moving `dotnet/samples:aspnetapp` tag

Open Beginner friendly
#18,747 0 comments 0 reactions 0 assignees View on GitHub
area-deployment
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

## Background

The KIND-based CLI E2E test `RadiusDeployTests.DeployRadiusContainerToKind` (added in #18730) uses a moving, deprecated sample image:

```csharp
// tests/Aspire.Cli.EndToEnd.Tests/RadiusDeployTests.cs
private const string ContainerImage = "mcr.microsoft.com/dotnet/samples:aspnetapp";
private const int ContainerPort = 8080;
```

Per [dotnet/dotnet-docker#7191](https://github.com/dotnet/dotnet-docker/issues/7191) and the `README.samples.md` support notes, the `dotnet/samples` images are **not stable and can break at any time**. This repo already migrated away from them elsewhere — see `tests/Aspire.Deployment.EndToEnd.Tests/AcaCompactNamingDeploymentTests.cs`, which now uses:

```csharp
builder.AddContainer("worker", "mcr.microsoft.com/azuredocs/aci-helloworld", "latest")
.WithImageSHA256("456a1150aa41340a14c7be1342deda2cde9e6e7df9fde6b8a69de0ae04f92fad")
```

This was raised in review on #18730 and **deferred** to avoid regressing a currently-green test as part of an otherwise low-risk review-fix commit.

## Proposed change

Migrate `RadiusDeployTests` to the same convention:

- `ContainerImage` → `mcr.microsoft.com/azuredocs/aci-helloworld`
- `ContainerPort` `8080` → `80` (flows through `WithHttpEndpoint(targetPort:)` and the `18080:{ContainerPort}` port-forward; curl on `/` still returns 200)
- Add `.WithImageSHA256("456a1150aa41340a14c7be1342deda2cde9e6e7df9fde6b8a69de0ae04f92fad")` to the generated AppHost wiring

## Things to verify

- Whether `WithImageSHA256(...)` flows the digest into the Radius-generated `app.bicep` (if not, the tag pin to a stable image still mitigates the primary instability concern, but the digest pin would be a no-op for the deployed pod).
- That `Assert.Contains(ContainerImage, appBicep)` still holds with the new image reference.
- This KIND E2E can only be re-validated in CI (amd64 runner); `aci-helloworld`'s image index is amd64-only, which is acceptable for CI but worth noting.

## Context

- PR: #18730
- Reference convention: `tests/Aspire.Deployment.EndToEnd.Tests/AcaCompactNamingDeploymentTests.cs`
- File to change: `tests/Aspire.Cli.EndToEnd.Tests/RadiusDeployTests.cs`

Contributor guide

Open the contributing guide

Research direction

Start in tests/Aspire.Cli.EndToEnd.Tests/RadiusDeployTests.cs, focusing on RadiusDeployTests.DeployRadiusContainerToKind and its ContainerImage and ContainerPort constants. Compare the generated AppHost wiring with tests/Aspire.Deployment.EndToEnd.Tests/AcaCompactNamingDeploymentTests.cs, then verify the image reference and digest in the generated app.bicep. Re-validate the KIND E2E test in CI on an amd64 runner.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
cli, testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.