Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: return update errors #55

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

tommy351
Copy link
Contributor

Sometimes the plugin prints the following error during an update. It might be better to return the error so it could be retried, or use patch instead of update.

2024-04-26T09:51:14.001Z [DEBUG] plugin.gatewayAPI: time="2024-04-26T09:51:14Z" level=error msg="error updating Gateway API \"app-widgets\": Operation cannot be fulfilled on httproutes.gateway.networking.k8s.io \"app-widgets\": the object has been modified; please apply your changes to the latest version and try again" plugin=trafficrouter

Signed-off-by: Tommy Chen <[email protected]>
Comment on lines 54 to 59
if err != nil {
msg := fmt.Sprintf(GatewayAPIUpdateError, httpRoute.GetName(), err)
r.LogCtx.Error(msg)
return pluginTypes.RpcError{
ErrorString: err.Error(),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we can delete this condition as if we will return error, argo rollouts controller will print message error
It will be great if you will check it and if it works then delete, please
Can you check it, please ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in de5559d.

I checked it and Argo Rollouts prints logs when the plugin returns an error.

2024-04-29T09:31:40.670Z [DEBUG] plugin.gatewayAPI: time="2024-04-29T09:31:40Z" level=error msg="error updating Gateway API \"test\": Operation cannot be fulfilled on
httproutes.gateway.networking.k8s.io \"test\": the object has been modified; please apply your changes to the latest version and try again" plugin=trafficrouter
time="2024-04-29T09:31:40Z" level=warning msg="failed to set weight via plugin: Operation cannot be fulfilled on httproutes.gateway.networking.k8s.io \"test\": the obj
ect has been modified; please apply your changes to the latest version and try again" event_reason=TrafficRoutingError namespace=default rollout=test

@Philipp-Plotnikov Philipp-Plotnikov changed the title Return update errors feat: return update errors Apr 29, 2024
@Philipp-Plotnikov Philipp-Plotnikov added the enhancement New feature or request label Apr 29, 2024
@Philipp-Plotnikov Philipp-Plotnikov merged commit 783225b into argoproj-labs:main Apr 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants