Skip to content

Commit

Permalink
api: export cluster name
Browse files Browse the repository at this point in the history
Signed-off-by: raaizik <[email protected]>
  • Loading branch information
raaizik committed Mar 28, 2024
1 parent 9d38bbf commit 05b374e
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 58 deletions.
2 changes: 2 additions & 0 deletions services/provider/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ type StorageClientStatus interface {
GetOperatorVersion() string
GetClusterID() string
GetNamespacedName() string
GetClusterName() string

SetPlatformVersion(string) StorageClientStatus
SetOperatorVersion(string) StorageClientStatus
SetClusterID(string) StorageClientStatus
SetNamespacedName(string) StorageClientStatus
SetClusterName(string) StorageClientStatus
}

type StorageClientOnboarding interface {
Expand Down
127 changes: 69 additions & 58 deletions services/provider/pb/provider.pb.go

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

5 changes: 5 additions & 0 deletions services/provider/pb/storageclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func (r *ReportStatusRequest) SetNamespacedName(namespacedName string) ifaces.St
return r
}

func (r *ReportStatusRequest) SetClusterName(clusterName string) ifaces.StorageClientStatus {
r.ClusterName = clusterName
return r
}

// ensure OnboardConsumerRequest satisfies StorageClientOnboarding interface
var _ ifaces.StorageClientOnboarding = &OnboardConsumerRequest{}

Expand Down
2 changes: 2 additions & 0 deletions services/provider/proto/provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ message ReportStatusRequest{
string clusterID = 4;
// NamespacedName is the name and namespace of the StorageClient
string NamespacedName = 5;
// clusterName is the name of the openshift cluster
string clusterName = 6;
}

message ReportStatusResponse{
Expand Down
1 change: 1 addition & 0 deletions services/provider/server/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (c *ocsConsumerManager) UpdateConsumerStatus(ctx context.Context, id string
consumerObj.Status.Client.OperatorVersion = status.GetOperatorVersion()
consumerObj.Status.Client.ClusterID = status.GetClusterID()
consumerObj.Status.Client.NamespacedName = status.GetNamespacedName()
consumerObj.Status.Client.ClusterName = status.GetClusterName()

if err := c.client.Status().Update(ctx, consumerObj); err != nil {
return fmt.Errorf("Failed to patch Status for StorageConsumer %v: %v", consumerObj.Name, err)
Expand Down

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

0 comments on commit 05b374e

Please sign in to comment.