Skip to content

Fix empty dts panic - #7116

Open
vishnukothakapu wants to merge 1 commit into
pipe-cd:masterfrom
vishnukothakapu:fix-empty-dts-panic
Open

Fix empty dts panic#7116
vishnukothakapu wants to merge 1 commit into
pipe-cd:masterfrom
vishnukothakapu:fix-empty-dts-panic

Conversation

@vishnukothakapu

Copy link
Copy Markdown

What this PR does:
Adds validation for empty DeployTargets across multiple pipedv1 stage plugins to prevent index out-of-bounds panics when accessing dts[0]. It also fixes a bug in the SDK where StagePluginServiceServer.ExecuteStage passed nil for deploy targets instead of correctly parsing them.

Why we need it:
If a user misconfigures their application with an empty targets list, or if the SDK fails to pass the targets properly, affected plugins (Terraform deployment, ECS plan preview, and Kubernetes plan preview) would experience an unhandled panic and crash the process during the execution or plan preview stages. These checks ensure the plugins return a clean failure status with a descriptive log message instead.

Which issue(s) this PR fixes:

Fixes #7115

Does this PR introduce a user-facing change?:
No. This is purely an internal bug fix and adds protective checks to prevent unhandled panics.

  • How are users affected by this change:
    Users with misconfigured deploy targets will now see a descriptive failure log in the PipeCD UI instead of the plugin crashing silently or hanging.
  • Is this breaking change:
    No.
  • How to migrate (if breaking change):
    N/A

Signed-off-by: Vishnu Kothakapu <vishnukothakapu27@gmail.com>
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.

Bug: Unvalidated empty DeployTargets causes out-of-bounds panic in multiple plugins and SDK

1 participant