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

RDR: exporting client info #2504

Merged
Merged
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
4 changes: 4 additions & 0 deletions api/v1alpha1/storageconsumer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ type ClientStatus struct {
PlatformVersion string `json:"platformVersion"`
// StorageClient Operator Version
OperatorVersion string `json:"operatorVersion"`
// ClusterID is the id of the openshift cluster
ClusterID string `json:"clusterId"`
// NamespacedName is the name and namespace of the StorageClient
NamespacedName string `json:"namespacedName"`
nb-ohad marked this conversation as resolved.
Show resolved Hide resolved
}

//+kubebuilder:object:root=true
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageconsumers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,21 @@ spec:
client:
description: Information of storage client received from consumer
properties:
clusterId:
description: ClusterID is the id of the openshift cluster
type: string
namespacedName:
description: NamespacedName is the name and namespace of the StorageClient
type: string
operatorVersion:
description: StorageClient Operator Version
type: string
platformVersion:
description: StorageClient Platform Version
type: string
required:
- clusterId
- namespacedName
- operatorVersion
- platformVersion
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,21 @@ spec:
client:
description: Information of storage client received from consumer
properties:
clusterId:
description: ClusterID is the id of the openshift cluster
type: string
namespacedName:
description: NamespacedName is the name and namespace of the StorageClient
type: string
operatorVersion:
description: StorageClient Operator Version
type: string
platformVersion:
description: StorageClient Platform Version
type: string
required:
- clusterId
- namespacedName
- operatorVersion
- platformVersion
type: object
Expand Down
8 changes: 8 additions & 0 deletions deploy/ocs-operator/manifests/storageconsumer.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,21 @@ spec:
client:
description: Information of storage client received from consumer
properties:
clusterId:
description: ClusterID is the id of the openshift cluster
type: string
namespacedName:
description: NamespacedName is the name and namespace of the StorageClient
type: string
operatorVersion:
description: StorageClient Operator Version
type: string
platformVersion:
description: StorageClient Platform Version
type: string
required:
- clusterId
- namespacedName
- operatorVersion
- platformVersion
type: object
Expand Down
4 changes: 4 additions & 0 deletions services/provider/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ type StorageClientStatus interface {
// no client is using it
GetPlatformVersion() string
GetOperatorVersion() string
GetClusterID() string
GetNamespacedName() string

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

type StorageClientOnboarding interface {
Expand Down
140 changes: 81 additions & 59 deletions services/provider/pb/provider.pb.go

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

10 changes: 10 additions & 0 deletions services/provider/pb/storageclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ func (r *ReportStatusRequest) SetOperatorVersion(version string) ifaces.StorageC
return r
}

func (r *ReportStatusRequest) SetClusterID(clusterID string) ifaces.StorageClientStatus {
r.ClusterID = clusterID
return r
}

func (r *ReportStatusRequest) SetNamespacedName(namespacedName string) ifaces.StorageClientStatus {
r.NamespacedName = namespacedName
return r
}

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

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

message ReportStatusResponse{
Expand Down
2 changes: 2 additions & 0 deletions services/provider/server/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ func (c *ocsConsumerManager) UpdateConsumerStatus(ctx context.Context, id string
consumerObj.Status.LastHeartbeat = metav1.Now()
consumerObj.Status.Client.PlatformVersion = status.GetPlatformVersion()
consumerObj.Status.Client.OperatorVersion = status.GetOperatorVersion()
consumerObj.Status.Client.ClusterID = status.GetClusterID()
consumerObj.Status.Client.NamespacedName = status.GetNamespacedName()

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
Loading
Loading