Skip to content

Commit

Permalink
Merge pull request #2671 from rewantsoni/rpc
Browse files Browse the repository at this point in the history
Add RPC calls for peering storageCluster
  • Loading branch information
openshift-merge-bot[bot] authored Oct 22, 2024
2 parents 2a2fdb2 + 22cda0a commit 1ea3ed4
Show file tree
Hide file tree
Showing 8 changed files with 569 additions and 132 deletions.
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 @@ -945,3 +945,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

0 comments on commit 1ea3ed4

Please sign in to comment.