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

Add logic in interceptor to update routing table from ConfigMap #11

Merged
merged 11 commits into from
Aug 12, 2021

Conversation

arschles
Copy link
Owner

requires #10 to be merged before this can be

khaosdoctor and others added 3 commits August 11, 2021 16:43
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>
@arschles arschles changed the title New routing table interceptor Add logic in interceptor to update routing table from ConfigMap Aug 11, 2021
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()
Copy link
Owner Author

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

return ret, nil
}

// GetTable fetches a table via an RPC call to operatorAdminURL, replaces the
Copy link
Owner Author

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{})
Copy link
Owner Author

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
Copy link
Owner Author

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

evtType := evt.Type
obj := evt.Object
if evtType == watch.Added || evtType == watch.Modified {
cm := obj.(*corev1.ConfigMap)
Copy link
Owner Author

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)
Copy link
Owner Author

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>
@arschles arschles merged commit f683e39 into global-components Aug 12, 2021
@arschles arschles deleted the new-routing-table-interceptor branch August 12, 2021 23:26
arschles added a commit that referenced this pull request Aug 18, 2021
Co-authored-by: Lucas Santos <lhs.santoss@gmail.com>
Signed-off-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
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.

2 participants