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

update storageconsumer api for centralising distribution and making it user facing #3062

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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
Loading