Skip to content

[ECS-Plugin] Implement ECS_CANARY_CLEAN stage#6608

Merged
khanhtc1202 merged 1 commit intopipe-cd:masterfrom
armistcxy:ecs-plugin/canary-clean
Apr 14, 2026
Merged

[ECS-Plugin] Implement ECS_CANARY_CLEAN stage#6608
khanhtc1202 merged 1 commit intopipe-cd:masterfrom
armistcxy:ecs-plugin/canary-clean

Conversation

@armistcxy
Copy link
Copy Markdown
Contributor

@armistcxy armistcxy commented Mar 22, 2026

What this PR does: Implement ECS_CANARY_CLEAN stage: Delete the canary taskset that previously deployed in ECS_CANARY_ROLLOUT stage

sequenceDiagram
        participant Plugin as ECSCanaryCleanStage
        participant Store as Metadata Store
        participant Provider as ECS Client
        participant ECS as AWS ECS

        Plugin->>Store: GetDeploymentPluginMetadata(canary-task-set)

        alt Metadata fetch error
            Plugin->>Plugin: Log error
            Plugin-->>Plugin: StageStatusFailure
        else Not found (no canary stage ran)
            Plugin->>Plugin: Log "nothing to clean up"
            Plugin-->>Plugin: StageStatusSuccess
        else Task set data found
            Plugin->>Plugin: Unmarshal TaskSet JSON
            alt Unmarshal error
                Plugin->>Plugin: Log error
                Plugin-->>Plugin: StageStatusFailure
            else Unmarshal success
                Plugin->>Provider: Create ECS client
                alt Client creation error
                    Plugin->>Plugin: Log error
                    Plugin-->>Plugin: StageStatusFailure
                else Client ready
                    Plugin->>ECS: DeleteTaskSet
                    alt TaskSetNotFoundException (already deleted — idempotent)
                        Plugin->>Plugin: Log "already deleted, skipping"
                        Plugin-->>Plugin: StageStatusSuccess
                    else Delete error
                        Plugin->>Plugin: Log error
                        Plugin-->>Plugin: StageStatusFailure
                    else Delete success
                        Plugin-->>Plugin: StageStatusSuccess
                    end
                end
            end
        end

Loading

Why we need it: Clean up the canary taskset

Which issue(s) this PR fixes: Part of #6443

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Hoang Ngo <adlehoang118@gmail.com>
@armistcxy armistcxy force-pushed the ecs-plugin/canary-clean branch from 0f43784 to dbdb812 Compare April 14, 2026 04:26
Copy link
Copy Markdown
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@khanhtc1202 khanhtc1202 merged commit 86ac796 into pipe-cd:master Apr 14, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants