pipe-cd / pipecd

The One CD for All {applications, platforms, operations}
https://pipecd.dev
Apache License 2.0
1.09k stars 153 forks source link

Sort subnet in live manifest of ECS Drift Detection #5254

Closed HoangNguyen689 closed 1 month ago

HoangNguyen689 commented 1 month ago

What this PR does / why we need it:

Issue: When viewing the details of the drift-detector on the PipeCD console, the order of subnets in the live state (red) matches the defined resource (servicedef.yaml), but the Git state (green) shows subnets in reverse order.

Investigation: After reviewing the AWS DescribeServices documentation, I found no evidence that AWS guarantees any sorting of subnets in the returned live state. It appears that PipeCD fetches the live state using DescribeServices.

Proposed Solution: I suggest adding explicit sorting of subnets in PipeCD before performing comparisons in the drift detector to avoid confusion.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?: No

t-kikuc commented 1 month ago

@HoangNguyen689 thank you so much. let me check again.

the solution might be one of: a. remove sorting as you mentioned b. sort both livestate and head

HoangNguyen689 commented 1 month ago

@t-kikuc Thank you. It seems that sorting both safer. But when thinking that the livestate is the same as we the resource we defined, maybe the sorting is unnecessary.

HoangNguyen689 commented 1 month ago

@t-kikuc I just changed to sort both the live state and the head manifest!

t-kikuc commented 1 month ago

@HoangNguyen689 thank you! I also think no sorting is ideal, but let me ask AWS support.

t-kikuc commented 1 month ago

@HoangNguyen689 I asked AWS Support and it turned out that sorting the subnets occurs but that might be changed in the future. (so that is not described in any docs)

That's why, sorting both live and head manifests is the best.