-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add logic in interceptor to update routing table from ConfigMap #11
Conversation
Signed-off-by: Lucas Santos <lhs.santoss@gmail.com>
Signed-off-by: Lucas Santos <lhs.santoss@gmail.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
…nto new-routing-table-interceptor Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
|
||
operatorRoutingFetchURL, err := operatorCfg.RoutingFetchURL() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: take old interceptor configurations out of helm chart
pkg/routing/config_map.go
Outdated
return ret, nil | ||
} | ||
|
||
// GetTable fetches a table via an RPC call to operatorAdminURL, replaces the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: this comment is outdated. fix it
q queue.Counter, | ||
) error { | ||
lggr = lggr.WithName("pkg.routing.StartConfigMapRoutingTableUpdater") | ||
watchIface, err := getterWatcher.Watch(ctx, metav1.ListOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: cancel the watch in a defer
|
||
case evt := <-watchIface.ResultChan(): | ||
evtType := evt.Type | ||
obj := evt.Object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: check the name of the configmap
pkg/routing/config_map_updater.go
Outdated
evtType := evt.Type | ||
obj := evt.Object | ||
if evtType == watch.Added || evtType == watch.Modified { | ||
cm := obj.(*corev1.ConfigMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: check that the type assertion succeeded
if err != nil { | ||
return err | ||
} | ||
table.Replace(newTable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: update the queue with the hosts in the new table
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Co-authored-by: Lucas Santos <lhs.santoss@gmail.com> Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
requires #10 to be merged before this can be