Skip to content

Commit

Permalink
update storageconsumer api
Browse files Browse the repository at this point in the history
Signed-off-by: Leela Venkaiah G <[email protected]>
  • Loading branch information
leelavg committed Mar 7, 2025
1 parent 22c98f1 commit 2542bdc
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 3 deletions.
35 changes: 33 additions & 2 deletions api/v1alpha1/storageconsumer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,22 @@ type StorageConsumerSpec struct {
Enable bool `json:"enable,omitempty"`
// StorageQuotaInGiB describes quota for the consumer
// +optional
StorageQuotaInGiB int `json:"storageQuotaInGiB,omitempty"`
StorageQuotaInGiB int `json:"storageQuotaInGiB,omitempty"`
StorageClasses []StorageClassSpec `json:"storageClasses,omitempty"`
VolumeSnapshotClasses []VolumeSnapshotClassSpec `json:"volumeSnapshotClasses,omitempty"`
VolumeGroupSnapshotClasses []VolumeGroupSnapshotClassSpec `json:"volumeGroupSnapshotClasses,omitempty"`
}

type StorageClassSpec struct {
Name string `json:"name"`
}

type VolumeSnapshotClassSpec struct {
Name string `json:"name"`
}

type VolumeGroupSnapshotClassSpec struct {
Name string `json:"name"`
}

// CephResourcesSpec hold details of created ceph resources required for external storage
Expand All @@ -62,11 +77,15 @@ type StorageConsumerStatus struct {
// State describes the state of StorageConsumer
State StorageConsumerState `json:"state,omitempty"`
// CephResources provide details of created ceph resources required for external storage
// +kubebuilder:deprecatedversion:warning="This field has been deprecated and will be removed in future."
CephResources []*CephResourcesSpec `json:"cephResources,omitempty"`
// Timestamp of last heartbeat received from consumer
LastHeartbeat metav1.Time `json:"lastHeartbeat,omitempty"`
// Information of storage client received from consumer
Client ClientStatus `json:"client,omitempty"`
Client ClientStatus `json:"client,omitempty"`
RadosNamespace RadosNamespaceStatus `json:"radosNamespace,omitempty"`
CephFsSubVolumeGroup SubVolumeGroupStatus `json:"cephFsSubVolumeGroup,omitempty"`
CephCsiClientProfiles []ClientProfileStatus `json:"cephCsiClientProfile,omitempty"`
}

// ClientStatus is the information pushed from connected storage client
Expand Down Expand Up @@ -100,6 +119,18 @@ type ClientStatus struct {
ID string `json:"clientId,omitempty"`
}

type RadosNamespaceStatus struct {
Name string `json:"name"`
}

type SubVolumeGroupStatus struct {
Name string `json:"name"`
}

type ClientProfileStatus struct {
Name string `json:"name"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

Expand Down
114 changes: 113 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

50 changes: 50 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageconsumers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,56 @@ spec:
enable:
description: Enable flag ignores a reconcile if set to false
type: boolean
storageClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
storageQuotaInGiB:
description: StorageQuotaInGiB describes quota for the consumer
type: integer
volumeGroupSnapshotClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
volumeSnapshotClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
type: object
status:
description: StorageConsumerStatus defines the observed state of StorageConsumer
properties:
cephCsiClientProfile:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
cephFsSubVolumeGroup:
properties:
name:
type: string
required:
- name
type: object
cephResources:
description: CephResources provide details of created ceph resources
required for external storage
Expand Down Expand Up @@ -103,6 +146,13 @@ spec:
description: Timestamp of last heartbeat received from consumer
format: date-time
type: string
radosNamespace:
properties:
name:
type: string
required:
- name
type: object
state:
description: State describes the state of StorageConsumer
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,56 @@ spec:
enable:
description: Enable flag ignores a reconcile if set to false
type: boolean
storageClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
storageQuotaInGiB:
description: StorageQuotaInGiB describes quota for the consumer
type: integer
volumeGroupSnapshotClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
volumeSnapshotClasses:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
type: object
status:
description: StorageConsumerStatus defines the observed state of StorageConsumer
properties:
cephCsiClientProfile:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
cephFsSubVolumeGroup:
properties:
name:
type: string
required:
- name
type: object
cephResources:
description: CephResources provide details of created ceph resources
required for external storage
Expand Down Expand Up @@ -103,6 +146,13 @@ spec:
description: Timestamp of last heartbeat received from consumer
format: date-time
type: string
radosNamespace:
properties:
name:
type: string
required:
- name
type: object
state:
description: State describes the state of StorageConsumer
type: string
Expand Down
Loading

0 comments on commit 2542bdc

Please sign in to comment.