Skip to content

[17.0] Document breaking change: Docker Swarm UpdateConfig.MaxFailureRatio changed from string? to double? #2129

Closed

Description

In Aspire 17.0, Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm.UpdateConfig.MaxFailureRatio in the stable Aspire.Hosting.Docker package changed from string? to double?. This breaks both source and binary compatibility, so it should be listed in the 17.0 breaking changes.

Why it changed

The Compose publisher quotes every string value, so MaxFailureRatio = "0.3" was published as max_failure_ratio: "0.3". Docker Swarm requires a number and rejects that file:

services.my-service.deploy.update_config.max_failure_ratio must be a number

The string? property could never produce a deployable value. As a double?, it's published as max_failure_ratio: 0.3.

Impact

  • Source: assigning a string, such as MaxFailureRatio = "0.3", no longer compiles (CS0029).
  • Binary: assemblies compiled against 13.x that get or set the property throw MissingMethodException at run time.

Migration

Assign a number instead of a string:

using Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm;

builder.AddContainer("my-service", "my-image:latest")
    .PublishAsDockerComposeService((resource, service) =>
    {
        service.Deploy = new Deploy
        {
            UpdateConfig = new UpdateConfig
            {
                MaxFailureRatio = 0.3 // Aspire 13.x: MaxFailureRatio = "0.3"
            }
        };
    });

Where to document

Add a row to the ⚠️ Breaking changes table on the 17.0 What's new page. There's no whats-new/aspire-17*.mdx on main yet. Aspire 13.3 listed a similar change (microsoft/aspire#15566, which changed Parallelism from string? to int?) as "Docker Swarm UpdateConfig property types changed" in aspire-13-3.mdx. For this entry, include the before and after values from the example above.

Activity

  1. added a commit that references this issue on Nov 17, 2026
    214c013
  2. IEvangelist commented on Nov 17, 2026

    @IEvangelist
    Member

    Addressed in #2188 (merged into release/17.0).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions