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

Syncing latest changes from main for ocs-operator #2845

Merged
merged 2 commits into from
Oct 9, 2024
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 @@ -90,6 +90,10 @@ type ClientStatus struct {
// Name is the name of connected storageclient
// +optional
Name string `json:"name,omitempty"`

// StorageQuotaUtilizationRatio is the ratio of utilized quota of connected client
// +optional
StorageQuotaUtilizationRatio float32 `json:"storageQuotaUtilizationRatio,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageconsumers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ spec:
platformVersion:
description: StorageClient Platform Version
type: string
storageQuotaUtilizationRatio:
description: StorageQuotaUtilizationRatio is the ratio of utilized
quota of connected client
type: number
type: object
lastHeartbeat:
description: Timestamp of last heartbeat received from consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ spec:
platformVersion:
description: StorageClient Platform Version
type: string
storageQuotaUtilizationRatio:
description: StorageQuotaUtilizationRatio is the ratio of utilized
quota of connected client
type: number
type: object
lastHeartbeat:
description: Timestamp of last heartbeat received from consumer
Expand Down
4 changes: 4 additions & 0 deletions deploy/ocs-operator/manifests/storageconsumer.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ spec:
platformVersion:
description: StorageClient Platform Version
type: string
storageQuotaUtilizationRatio:
description: StorageQuotaUtilizationRatio is the ratio of utilized
quota of connected client
type: number
type: object
lastHeartbeat:
description: Timestamp of last heartbeat received from consumer
Expand Down

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

2 changes: 2 additions & 0 deletions services/provider/api/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ type StorageClientStatus interface {
GetClusterID() string
GetClusterName() string
GetClientName() string
GetStorageQuotaUtilizationRatio() float32

SetPlatformVersion(string) StorageClientStatus
SetOperatorVersion(string) StorageClientStatus
SetClusterID(string) StorageClientStatus
SetClusterName(string) StorageClientStatus
SetClientName(string) StorageClientStatus
SetStorageQuotaUtilizationRatio(float32) StorageClientStatus
}

type StorageClientOnboarding interface {
Expand Down
129 changes: 71 additions & 58 deletions services/provider/api/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/api/storageclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func (r *ReportStatusRequest) SetClusterName(clusterName string) ifaces.StorageC
return r
}

func (r *ReportStatusRequest) SetStorageQuotaUtilizationRatio(storageQuotaUtilizationRatio float32) ifaces.StorageClientStatus {
r.StorageQuotaUtilizationRatio = storageQuotaUtilizationRatio
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 @@ -171,6 +171,8 @@ message ReportStatusRequest{
string clusterName = 5;
// clientName is the name of the connected storageclient
string clientName = 6;
// storageQuotaUtilizationRatio is the ratio of utilized quota of connected client
float storageQuotaUtilizationRatio = 7;

}

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 @@ -219,6 +219,7 @@ func (c *ocsConsumerManager) UpdateConsumerStatus(ctx context.Context, id string
consumerObj.Status.Client.ClusterID = status.GetClusterID()
consumerObj.Status.Client.Name = status.GetClientName()
consumerObj.Status.Client.ClusterName = status.GetClusterName()
consumerObj.Status.Client.StorageQuotaUtilizationRatio = status.GetStorageQuotaUtilizationRatio()

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.

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

Loading
Loading