-
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
feat(server): implement syncer service APIs #336
Conversation
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.
LG!
|
||
// DeleteKubernetesObject deletes a kubernetes object. | ||
func (ss *SS) DeleteKubernetesObject(ctx context.Context, req *v1.DeleteKubernetesObjectRequest) (*v1.DeleteKubernetesObjectResponse, error) { | ||
apikey, err := auth.ExtractTokenFromContext(ctx) |
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.
how about adding the request validation (e.g., return an error if req.ClusterId
is empty)?
|
||
// PatchKubernetesObject applies a kubernetes object. | ||
func (ss *SS) PatchKubernetesObject(ctx context.Context, req *v1.PatchKubernetesObjectRequest) (*v1.PatchKubernetesObjectResponse, error) { | ||
userInfo, ok := auth.ExtractUserInfoFromContext(ctx) |
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.
how about adding the request validation?
return nil, err | ||
} | ||
|
||
sresult, err := ss.scheduler.Schedule(userInfo) |
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.
Question: Is this correct that PatchKubernetesObject
is currently called when a new resource is created? My understanding is that we need to find out which cluster a resource is located when the resource is being updated.
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.
Yes, I have only tested the creation path currently. Eventually, to support creation and updating in this same function, I plan to store cluster info as a resource annotation in the tenant cluster and use it for updating. I'll leave a TODO comment 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.
Sounds good!
No description provided.