Skip to content

Commit

Permalink
feat: return update errors (#55)
Browse files Browse the repository at this point in the history
* Return update errors

Signed-off-by: Tommy Chen <[email protected]>

* Remove unnecessary error logs

Signed-off-by: Tommy Chen <[email protected]>

---------

Signed-off-by: Tommy Chen <[email protected]>
  • Loading branch information
tommy351 authored Apr 29, 2024
1 parent 47954c2 commit 783225b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/plugin/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ func (r *RpcPlugin) setHTTPRouteWeight(rollout *v1alpha1.Rollout, desiredWeight
r.UpdatedHTTPRouteMock = updatedHTTPRoute
}
if err != nil {
msg := fmt.Sprintf(GatewayAPIUpdateError, httpRoute.GetName(), err)
r.LogCtx.Error(msg)
return pluginTypes.RpcError{
ErrorString: err.Error(),
}
}
return pluginTypes.RpcError{}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/plugin/tcproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package plugin
import (
"context"
"errors"
"fmt"

"github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1"
pluginTypes "github.com/argoproj/argo-rollouts/utils/plugin/types"
Expand Down Expand Up @@ -50,8 +49,9 @@ func (r *RpcPlugin) setTCPRouteWeight(rollout *v1alpha1.Rollout, desiredWeight i
r.UpdatedTCPRouteMock = updatedTCPRoute
}
if err != nil {
msg := fmt.Sprintf(GatewayAPIUpdateError, tcpRoute.GetName(), err)
r.LogCtx.Error(msg)
return pluginTypes.RpcError{
ErrorString: err.Error(),
}
}
return pluginTypes.RpcError{}
}
Expand Down

0 comments on commit 783225b

Please sign in to comment.