-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
refactor(multicluster): Replace use of unstructured API with typed bindings for Link CR #13420
Conversation
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
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.
This is awesome; nice riddance of the unstructured
mess!
One minor thing: we still have old versions for both server
and link
in bin/update-codegen.sh
, can you update that as well?
cleanupWorkers() | ||
// Use a small buffered channel for Link updates to avoid dropping | ||
// updates if there is an update burst. | ||
results := make(chan *v1alpha2.Link, 100) |
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.
Would be cool as a followup to get a metric on the size of this queue and/or the number of dropped updates
@@ -58,7 +58,7 @@ rules: | |||
verbs: ["list", "get", "watch"] | |||
- apiGroups: ["multicluster.linkerd.io"] | |||
resources: ["links/status"] | |||
verbs: ["update"] | |||
verbs: ["update", "patch"] |
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.
Do you know if we still require update
here?
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.
I don't believe so, but it might be safer to keep it to give us more flexibility in terms of the exact API calls that are used to update the status.
The linkerd-multicluster extension uses client-go's
unstructured
API to access Link custom resources. This API allowed us to develop quickly without the work of generating typed bindings. However, using the unstrucutred API is error prone since fields must be accessed by their string name. It is also inconsistent with the rest of the project which uses typed bindings.We replace the use of the unstructured API for Link resources with generated typed bindings. The client-go APIs are slightly different and client-go does not provide a way to update subresources for typed bindings. Therefore, when updating a Link's status subresource, we use a patch instead of an update.