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

Đang mở Phù hợp với người mới
#2,129 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, docker
Lĩnh vực
documentation

Hướng nghiên cứu

Dùng bảng breaking changes hiện có trên trang What's New của Aspire 13.3 làm tài liệu tham khảo. Khi trang What's New của Aspire 17.0 được thêm vào, hãy thêm một hàng mô tả việc UpdateConfig.MaxFailureRatio của Docker Swarm đổi từ string? sang double?, bao gồm các giá trị trước và sau trong ví dụ di chuyển. Hoàn thành khi mục 17.0 giải thích rõ breaking change và phép gán số.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
MDX
Star
202
Fork
99
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
97

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/aspire.dev

Tất cả issue của microsoft/aspire.dev

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.