fix(registry): improve error handling in docker operations

- Replace boolean return values with proper error handling in dockerTag and dockerPush functions
- Add detailed error context including Docker command exit codes and stderr output
- Remove TODO comments and improve error messages for better debugging
- Fix error message formatting in defer function

This addresses the TODO comments for better error handling and provides
users with actionable error information when Docker registry operations fail.

Closes: #XXXX
This commit is contained in:
Naman gandhi
2025-06-25 17:47:39 +05:30
committed by Jose Diaz-Gonzalez
parent 3354effff0
commit 8b07e92391
2 changed files with 29 additions and 23 deletions

View File

@@ -1,7 +1,6 @@
package registry
import (
"errors"
"fmt"
"strings"
@@ -108,9 +107,8 @@ func TriggerPostReleaseBuilder(appName string, image string) error {
newImage := strings.Replace(image, imageRepo+":", computedImageRepo+":", 1)
if computedImageRepo != imageRepo {
if !dockerTag(imageID, newImage) {
// TODO: better error
return errors.New("Unable to tag image")
if err := dockerTag(imageID, newImage); err != nil {
return fmt.Errorf("unable to tag image %s as %s: %w", imageID, newImage, err)
}
}