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

initial implementation of setHeaderRoute behavior #5

Merged
merged 11 commits into from
Oct 31, 2024

Conversation

ilrudie
Copy link
Collaborator

@ilrudie ilrudie commented Oct 24, 2024

adds setHeaderRoute implementation

Signed-off-by: Ian Rudie <[email protected]>
pkg/plugin/plugin_test.go Outdated Show resolved Hide resolved
pkg/plugin/testfiles/20-setRouteHeader.yaml Outdated Show resolved Hide resolved
pkg/plugin/testfiles/20-setRouteHeader.yaml Outdated Show resolved Hide resolved
pkg/plugin/plugin_canary.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Show resolved Hide resolved
Comment on lines +31 to +36
# managedRoutes are required for using setHeaderRoute
# routes specified here are owned by the plugin
# the plugin will create/delete these routes as needed
# do not specify routes which are already otherwise in use under this field
managedRoutes:
- name: header-canary

Choose a reason for hiding this comment

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

It'd be great if we could detect if a Route Table has never been affected by a Rollout so that we can error. Not quite sure something like that exists.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Off the top of my head the best I can think of would be to warn that a managed route with the name we are meant to add was found while we're adding the route

pkg/plugin/plugin.go Outdated Show resolved Hide resolved
Comment on lines 178 to 179
// nothing to update, don't bother computing things
return pluginTypes.RpcError{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we throw an error if nothing is selected? The GP API is not entirely consistent in handling this scenario today, but we've definitely had feedback that it's confusing UX for users if e.g. selectors don't match because of a missing label or typo, they're wondering why the entire resource "does nothing".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What would this error say?

"Unable to find RouteTables which match {labelSelectors}, a matching RouteTable must already exist because the glooplatform plugin does not create new RouteTables"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think just the first part is probably sufficient:

Unable to find any RouteTables which match {labelSelectors}

It at least gives folks a starting point for troubleshooting. If we have enough flexibility for this to be a "warning" rather than an "error", that's even better... but IDK if we have that flexibility with this particular API

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can select a rt by name, name/namespace or labelSelectors so for now I added a basic error with a TODO to enhance it with the search criteria used which failed to produce a satisfactory result

pkg/plugin/plugin.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@Sodman Sodman left a comment

Choose a reason for hiding this comment

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

LGTM

@Sodman Sodman merged commit 08087e4 into argoproj-labs:main Oct 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants