pipecd
pipecd copied to clipboard
fix: for error wrapping in cancelDeployment
What happened?
In pkg/app/piped/controller/controller.go, the cancelDeployment function formats an error using %v instead of %w when wrapping an underlying error returned from ReportDeploymentCompleted.
This causes the original error to be stringified rather than properly wrapped, breaking Go error chaining. As a result, callers cannot use errors.Is() or errors.As() to inspect or match the underlying error.
In contrast, other functions in the same file (e.g. reportApplicationDeployingStatus) correctly use %w for error wrapping.
Affected code location
File: pkg/app/piped/controller/controller.go
cancelDeployment (~line 650):
err = fmt.Errorf("failed to report deployment status to control-plane: %v", err)