Repository navigation
Fix multi-arch container label parsing - #55414
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR fixes parsing of multi-architecture container labels that are serialized as key:value when passed to inner builds. The existing MSBuild target split on all colons and truncated label values containing colons (e.g., https://... URLs and RFC 3339 timestamps), producing incorrect OCI label metadata.
Changes:
- Update
_ParseItemsForPublishingSingleContainerto split label entries only on the first colon (Split(':', 2)), preserving the remainder of the value. - Add an integration regression test ensuring multi-arch label values containing colons (URL + timestamp) round-trip correctly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs | Adds regression coverage validating that multi-arch label parsing preserves colons in values. |
| src/Containers/packaging/build/Microsoft.NET.Build.Containers.targets | Fixes label parsing by limiting the split to two parts (key + remainder value). |
|
@dotnet-policy-service agree |
|
/backport to release/11.0.1xx-preview7 |
|
Started backporting to |
|
@jetersen this will be in RC1 in September for sure, but am backporting to the p7 branch so you can hopefully see it in p7 too! |
|
@baronfel yes! That's sounds great 👏 |
Inline the image name instead of a job variable, give skopeo a timeout, split labels like dotnet/sdk#55414 does and note when the workaround can go.
Summary
Root cause
Multi-architecture inner builds receive labels serialized as
key:value._ParseItemsForPublishingSingleContainerused an unrestrictedSplit(':')and selected element 1, truncating everything after the next colon.Fixes #52732.
Validation
containers.slnfbuilds successfully with zero warnings or errors_ParseItemsForPublishingSingleContainerpreserves both URL and RFC 3339 valuesThe repository test runner requires a built redist SDK; the attempted redist build was blocked by an unrelated missing
project.assets.jsonin the Static Web Assets tool chain.