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 RPC calls for peering storageCluster #2671

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions services/provider/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,19 @@ func (cc *OCSProviderClient) ReportStatus(ctx context.Context, consumerUUID stri

return cc.Client.ReportStatus(apiCtx, req)
}

func (cc *OCSProviderClient) PeerStorageCluster(ctx context.Context, onboardingToken, storageClusterUID string) (*pb.PeerStorageClusterResponse, error) {
if cc.Client == nil || cc.clientConn == nil {
return nil, fmt.Errorf("OCS client is closed")
}

req := &pb.PeerStorageClusterRequest{
OnboardingToken: onboardingToken,
StorageClusterUID: storageClusterUID,
}

apiCtx, cancel := context.WithTimeout(ctx, cc.timeout)
defer cancel()

return cc.Client.PeerStorageCluster(apiCtx, req)
}
285 changes: 219 additions & 66 deletions services/provider/api/provider.pb.go

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions services/provider/api/provider_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions services/provider/proto/provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ service OCSProvider {

rpc ReportStatus(ReportStatusRequest)
returns (ReportStatusResponse){}

// PeerStorageCluster RPC call to Peer the local Storage Cluster to the remote
rpc PeerStorageCluster(PeerStorageClusterRequest)
returns (PeerStorageClusterResponse) {}

}

// OnboardConsumerRequest holds the required information to validate the consumer and create StorageConsumer
Expand Down Expand Up @@ -182,3 +187,17 @@ message ReportStatusResponse{
string desiredConfigHash = 2;

}

// PeerStorageClusterRequest holds the required information to Peer to remote StorageCluster
message PeerStorageClusterRequest{
// onboardingToken authenticates the StorageCluster
string onboardingToken = 1;
// storageClusterUID is the k8s UID of the StorageCluster in the same namespace
string storageClusterUID = 2;
}

// PeerStorageClusterResponse holds the response for OnboardStorageClusterPeer API request
message PeerStorageClusterResponse{
// storageClusterUID is the k8s UID of the remote StorageCluster
string storageClusterUID = 1;
}
4 changes: 4 additions & 0 deletions services/provider/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,3 +892,7 @@ func extractMonitorIps(data string) ([]string, error) {
slices.Sort(ips)
return ips, nil
}

func (s *OCSProviderServer) PeerStorageCluster(_ context.Context, _ *pb.PeerStorageClusterRequest) (*pb.PeerStorageClusterResponse, error) {
return &pb.PeerStorageClusterResponse{}, nil
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading