This repository was archived by the owner on Jun 11, 2025. It is now read-only.
feat: tenant-agent now syncs Cluster Gateway resource prior to streaming#386
Merged
Conversation
Reviewer's Guide by SourceryThis PR implements functionality for tenant-agent to sync Cluster Gateway resources before streaming. The changes include adding new gRPC service methods for gateway resource management and modifying the tenant-agent to fetch gateway resources during initialization. Sequence diagram for syncing Cluster Gateway resourcesequenceDiagram
participant TenantAgent
participant MessageOffice
participant InfraService
participant Domain
TenantAgent->>MessageOffice: SendClusterGatewayResource request
MessageOffice->>InfraService: GetClusterGatewayResource request
InfraService->>Domain: GetGatewayResource(accountName, clusterName)
Domain-->>InfraService: GatewayResource
InfraService-->>MessageOffice: GatewayResource
MessageOffice-->>TenantAgent: GatewayResource
TenantAgent->>TenantAgent: Apply GatewayResource YAML
Class diagram for new gRPC service methodsclassDiagram
class GetClusterGatewayResourceIn {
+string AccountName
+string ClusterName
}
class GetClusterGatewayResourceOut {
+byte[] Gateway
}
class grpcServer {
+GetClusterGatewayResource(ctx, in GetClusterGatewayResourceIn) GetClusterGatewayResourceOut
}
class Domain {
+GetGatewayResource(ctx, accountName, clusterName) Gateway
}
grpcServer --> GetClusterGatewayResourceIn
grpcServer --> GetClusterGatewayResourceOut
grpcServer --> Domain
Domain --> GetClusterGatewayResourceOut
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @nxtcoder17 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| return errors.NewE(err) | ||
| } | ||
|
|
||
| if _, err := g.yamlClient.ApplyYAML(ctx, out.Gateway); err != nil { |
There was a problem hiding this comment.
suggestion (bug_risk): Consider returning the error from ApplyYAML instead of just logging it
Since this is initialization code for the gateway resource, failing to apply it should probably trigger a retry of the whole connection setup.
result, err := g.yamlClient.ApplyYAML(ctx, out.Gateway)
if err != nil {
return fmt.Errorf("failed to apply gateway YAML: %w", err)
}
d13084f to
d87efdd
Compare
abdheshnayak
pushed a commit
that referenced
this pull request
Nov 5, 2024
…ange feat: tenant-agent now syncs Cluster Gateway resource prior to streaming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves kloudlite/kloudlite#299
Resolves kloudlite/kloudlite#300
Resolves kloudlite/kloudlite#301
Resolves kloudlite/kloudlite#298
Summary by Sourcery
Add functionality to sync Cluster Gateway resources in the tenant-agent before streaming, and enhance the infrastructure service with a new gRPC method for retrieving these resources.
New Features:
Enhancements: