diff --git a/go.mod b/go.mod index 73492fef..81e2e9bf 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/google/gofuzz v1.1.0 // indirect github.com/google/uuid v1.1.2 // indirect github.com/googleapis/gnostic v0.5.5 // indirect - github.com/hwameistor/hwameistor v0.10.3 + github.com/hwameistor/hwameistor v0.12.1 github.com/imdario/mergo v0.3.12 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect diff --git a/go.sum b/go.sum index dd2ff540..2f03d941 100644 --- a/go.sum +++ b/go.sum @@ -268,8 +268,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hwameistor/hwameistor v0.10.3 h1:kzT49leBii8483uhgWKO/f/BlNBmHK8ZsdRD6KrDO/s= -github.com/hwameistor/hwameistor v0.10.3/go.mod h1:dSa57fdYByPS6jTWUi5UodwkQhyo3XKP0UzNHLhhmcI= +github.com/hwameistor/hwameistor v0.12.1 h1:Y4K8jPCPpwTw6IqNFeQSBWc6bd/f/Eh9RxkJKu84Cjs= +github.com/hwameistor/hwameistor v0.12.1/go.mod h1:Ht+wwZlbtZilKHabhQWAAxmK8o4SDUgvbULjo+mUbp8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= diff --git a/helm/operator/values.yaml b/helm/operator/values.yaml index f7e43e54..b82d7048 100644 --- a/helm/operator/values.yaml +++ b/helm/operator/values.yaml @@ -5,7 +5,7 @@ global: #hwameistorImageRegistry: ghcr.m.daocloud.io k8sImageRegistry: registry.k8s.io # k8sImageRegistry: m.daocloud.io/registry.k8s.io - hwameistorVersion: v0.10.3 + hwameistorVersion: v0.12.1 operator: replicas: 1 @@ -17,7 +17,7 @@ localDiskManager: kubeletRootDir: /var/lib/kubelet manager: imageRepository: hwameistor/local-disk-manager - tag: v0.10.3 + tag: v0.12.1 csi: registrar: imageRepository: sig-storage/csi-node-driver-registrar @@ -37,7 +37,7 @@ localStorage: kubeletRootDir: /var/lib/kubelet member: imageRepository: hwameistor/local-storage - tag: v0.10.3 + tag: v0.12.1 csi: registrar: imageRepository: sig-storage/csi-node-driver-registrar @@ -65,25 +65,25 @@ scheduler: disable: false replicas: 1 imageRepository: hwameistor/scheduler - tag: v0.10.3 + tag: v0.12.1 admission: disable: false replicas: 1 imageRepository: hwameistor/admission - tag: v0.10.3 + tag: v0.12.1 evictor: disable: false replicas: 1 imageRepository: hwameistor/evictor - tag: v0.10.3 + tag: v0.12.1 apiserver: disable: false replicas: 1 imageRepository: hwameistor/apiserver - tag: v0.10.3 + tag: v0.12.1 authentication: enable: false accessId: admin @@ -93,13 +93,13 @@ exporter: disable: false replicas: 1 imageRepository: hwameistor/exporter - tag: v0.10.3 + tag: v0.12.1 ui: disable: false replicas: 1 imageRepository: hwameistor/hwameistor-ui - tag: v0.10.0 + tag: v0.12.1 ha: disable: false diff --git a/pkg/install/constants.go b/pkg/install/constants.go index d5dd79e6..9b7fa867 100644 --- a/pkg/install/constants.go +++ b/pkg/install/constants.go @@ -1,3 +1,3 @@ package install -const DefaultHwameistorVersion = "v0.10.3" \ No newline at end of file +const DefaultHwameistorVersion = "v0.12.1" \ No newline at end of file diff --git a/pkg/install/ui/ui.go b/pkg/install/ui/ui.go index 967efb55..cc5ff789 100644 --- a/pkg/install/ui/ui.go +++ b/pkg/install/ui/ui.go @@ -61,8 +61,9 @@ var ui = appsv1.Deployment{ Name: uiContainerName, Ports: []corev1.ContainerPort{ { - ContainerPort: 80, + ContainerPort: 8080, Protocol: corev1.ProtocolTCP, + Name: "http", }, }, }, diff --git a/pkg/install/ui/ui_service.go b/pkg/install/ui/ui_service.go index 60b93542..e91ba0b7 100644 --- a/pkg/install/ui/ui_service.go +++ b/pkg/install/ui/ui_service.go @@ -38,8 +38,8 @@ var uiService = corev1.Service{ Port: 80, Protocol: corev1.ProtocolTCP, TargetPort: intstr.IntOrString{ - Type: intstr.Int, - IntVal: 80, + Type: intstr.String, + StrVal: "http", }, }, }, diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_events_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_events_crd.yaml new file mode 100644 index 00000000..4b0162c5 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_events_crd.yaml @@ -0,0 +1,96 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: events.hwameistor.io +spec: + group: hwameistor.io + names: + kind: Event + listKind: EventList + plural: events + shortNames: + - evt + singular: event + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.resourceType + name: type + type: string + - jsonPath: .spec.resourceName + name: resource + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Event is the Schema for the events API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: EventSpec defines the desired state of Event + properties: + records: + items: + properties: + action: + description: The action is the operation on the resource, such + as Migrate a LocalVolume + type: string + actionContent: + description: The content of the action which is a JSON string + type: string + id: + description: id is unique + type: string + state: + description: The state of the action + type: string + stateContent: + description: The content of the action state which is a JSON + string + type: string + time: + description: The time when does the action happen + format: date-time + type: string + type: object + type: array + resourceName: + description: Name of the resource + type: string + resourceType: + description: 'HwameiStor resource type: Cluster, LocalStorageNode, + LocalDiskNode, Pool, LocalVolume, LocalDiskVolume, LocalDisk,' + enum: + - Cluster + - StorageNode + - DiskNode + - Pool + - Volume + - DiskVolume + - Disk + type: string + required: + - records + - resourceName + - resourceType + type: object + status: + description: EventStatus defines the observed state of Event + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskclaims_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskclaims_crd.yaml index 0f494723..d9e5f5f7 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskclaims_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskclaims_crd.yaml @@ -127,6 +127,7 @@ spec: type: string required: - nodeName + - owner type: object status: description: LocalDiskClaimStatus defines the observed state of LocalDiskClaim diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisknodes_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisknodes_crd.yaml index 6e1526ee..0153a540 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisknodes_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisknodes_crd.yaml @@ -196,6 +196,7 @@ spec: type: string required: - nodeName + - owner type: object type: array description: PoolExtendRecords record why disks are joined in the diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisks_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisks_crd.yaml index c31b3e8e..3e136a26 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisks_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdisks_crd.yaml @@ -17,6 +17,21 @@ spec: - jsonPath: .spec.nodeName name: NodeMatch type: string + - jsonPath: .spec.capacity + name: Capacity + priority: 1 + type: integer + - jsonPath: .spec.preNodeName + name: PreNodeMatch + priority: 1 + type: string + - jsonPath: .spec.devicePath + name: DevicePath + type: string + - jsonPath: .spec.preDevicePath + name: PreDevicePath + priority: 1 + type: string - jsonPath: .spec.owner name: Owner priority: 1 @@ -32,6 +47,12 @@ spec: name: Reserved priority: 1 type: boolean + - jsonPath: .spec.state + name: State + type: string + - jsonPath: .metadata.creationTimestamp + name: age + type: date name: v1alpha1 schema: openAPIV3Schema: @@ -93,6 +114,11 @@ spec: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object + devLinks: + description: DevLinks are symbol links for this device + items: + type: string + type: array devicePath: description: DevicePath is the disk path in the OS type: string @@ -139,6 +165,12 @@ spec: isRaid: description: HasRAID identifies if the disk is a raid disk or not type: boolean + major: + description: Major represents drive used by the device + type: string + minor: + description: Minor is used to distinguish different devices + type: string nodeName: description: NodeName represents the node where the disk is attached type: string @@ -180,6 +212,13 @@ spec: description: HasPartition represents if the disk has partitions or not type: boolean + preDevicePath: + description: PreDevicePath represents the last device path in the + OS + type: string + preNodeName: + description: PreNodeName represents the node where the disk was attached + type: string raidInfo: description: RAIDInfo contains RAID information properties: @@ -217,6 +256,7 @@ spec: description: UUID global unique identifier of the disk type: string required: + - devLinks - nodeName type: object status: diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskvolumes_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskvolumes_crd.yaml index 1027e5ee..3153c64c 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskvolumes_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localdiskvolumes_crd.yaml @@ -102,6 +102,13 @@ spec: in bytes format: int64 type: integer + devLinks: + additionalProperties: + items: + type: string + type: array + description: DevLinks is the set of symlink of a disk + type: object devPath: description: DevPath is the disk path in the OS type: string @@ -147,6 +154,9 @@ spec: description: UsedCapacityBytes is the real used capacity in bytes format: int64 type: integer + volumePath: + description: VolumePath is the volume path in the OS + type: string required: - devPath type: object diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localstoragenodes_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localstoragenodes_crd.yaml index 0732ef39..26df3def 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localstoragenodes_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localstoragenodes_crd.yaml @@ -195,6 +195,7 @@ spec: type: string required: - nodeName + - owner type: object type: array description: PoolExtendRecords record why disks are joined in the diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicas_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicas_crd.yaml index e4bd3b4f..d36783c9 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicas_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicas_crd.yaml @@ -78,6 +78,16 @@ spec: volumeName: description: VolumeName is the name of the volume, e.g. pvc-fbf3ffc3-66db-4dae-9032-bda3c61b8f85 type: string + volumeQoS: + description: VolumeQoS is the QoS of the volume + properties: + iops: + description: IOPS defines the IOPS of the volume + type: string + throughput: + description: Throughput defines the throughput of the volume + type: string + type: object type: object status: description: LocalVolumeReplicaStatus defines the observed state of LocalVolumeReplica diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshotrecovers_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshotrecovers_crd.yaml new file mode 100644 index 00000000..5cb069fa --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshotrecovers_crd.yaml @@ -0,0 +1,118 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: localvolumereplicasnapshotrecovers.hwameistor.io +spec: + group: hwameistor.io + names: + kind: LocalVolumeReplicaSnapshotRecover + listKind: LocalVolumeReplicaSnapshotRecoverList + plural: localvolumereplicasnapshotrecovers + shortNames: + - lvrsrecover + - lvrsnaprecover + singular: localvolumereplicasnapshotrecover + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Node to recover + jsonPath: .spec.nodeName + name: nodeName + type: string + - description: Target for the recover + jsonPath: .spec.targetVolume + name: targetvolume + type: string + - description: Source snapshot for the recover + jsonPath: .spec.sourceVolumeSnapshot + name: sourcesnapshot + type: string + - description: State of the recover + jsonPath: .status.state + name: state + type: string + - jsonPath: .metadata.creationTimestamp + name: age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: LocalVolumeReplicaSnapshotRecover is the Schema for the localvolumereplicasnapshotrecovers + API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: LocalVolumeReplicaSnapshotRecoverSpec defines the desired + state of LocalVolumeReplicaSnapshotRecover + properties: + abort: + default: false + description: Abort can be used to abort the recover operation and + clean up sub resources created by the recover operation automatically + type: boolean + nodeName: + description: NodeName is the name of the node that snapshot will be + recovered at + type: string + recoverType: + default: restore + description: RecoverType is the type about how to recover the volume, + e.g. rollback, restore. By default restore. + enum: + - rollback + - restore + type: string + sourceVolumeReplicaSnapshot: + description: SourceVolumeReplicaSnapshot represents which replica + snapshot is used for volume to recover from + type: string + sourceVolumeSnapshot: + description: SourceVolumeSnapshot represents which snapshot is used + for volume to recover from + type: string + targetPoolName: + description: TargetVolume is the name of the target volume will place + at + type: string + targetVolume: + description: TargetVolume is the name of the volume to recover to + type: string + volumeSnapshotRecover: + type: string + required: + - nodeName + - recoverType + - sourceVolumeReplicaSnapshot + - sourceVolumeSnapshot + - targetPoolName + - targetVolume + - volumeSnapshotRecover + type: object + status: + description: LocalVolumeReplicaSnapshotRecoverStatus defines the observed + state of LocalVolumeReplicaSnapshotRecover + properties: + message: + description: Message error message to describe some states + type: string + state: + description: State is the phase of recover volume snapshot, e.g. submitted, + started, completed, abort, ... + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshots_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshots_crd.yaml new file mode 100644 index 00000000..895b5fa7 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumereplicasnapshots_crd.yaml @@ -0,0 +1,147 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: localvolumereplicasnapshots.hwameistor.io +spec: + group: hwameistor.io + names: + kind: LocalVolumeReplicaSnapshot + listKind: LocalVolumeReplicaSnapshotList + plural: localvolumereplicasnapshots + shortNames: + - lvrs + singular: localvolumereplicasnapshot + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Allocated capacity of the snapshot + jsonPath: .status.allocatedCapacityBytes + name: Capacity + type: integer + - description: Node where snapshot is located + jsonPath: .spec.nodeName + name: NodeName + type: string + - description: Name of the snapshot's source volume + jsonPath: .spec.sourceVolume + name: SourceVolume + type: string + - description: State of the snapshot + jsonPath: .status.state + name: State + type: string + - description: if the snapshot is merging + jsonPath: .status.attr.merging + name: Merging + type: string + - description: if the snapshot is invalid + jsonPath: .status.attr.invalid + name: Invalid + type: string + - jsonPath: .status.creationTime + name: Age + type: date + - description: Name of the snapshot's source volume replica + jsonPath: .spec.sourceVolumeReplica + name: SourceVolumeReplica + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: LocalVolumeReplicaSnapshot is the Schema for the localvolumereplicasnapshots + API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: LocalVolumeReplicaSnapshotSpec represents the actual localvolume + snapshot object in lvm + properties: + delete: + default: false + description: Delete this snapshot if it is true + type: boolean + nodeName: + description: NodeName specifies which node the snapshot will be placed + type: string + poolName: + description: PoolName specifies which volume group the snapshot and + source volume is placed valid options are LocalStorage_PoolHDD, + LocalStorage_PoolSSD, LocalStorage_PoolNVMe + enum: + - LocalStorage_PoolHDD + - LocalStorage_PoolSSD + - LocalStorage_PoolNVMe + type: string + requiredCapacityBytes: + description: RequiredCapacityBytes specifies the space reserved for + the snapshot + format: int64 + minimum: 4194304 + type: integer + sourceVolume: + description: SourceVolume specifies the source volume name of the + snapshot + type: string + sourceVolumeReplica: + description: SourceVolume specifies the source volume replica name + of the snapshot + type: string + volumeSnapshotName: + description: VolumeSnapshotName represents the name of volume snapshot + type: string + required: + - nodeName + - poolName + - requiredCapacityBytes + - sourceVolume + - sourceVolumeReplica + - volumeSnapshotName + type: object + status: + description: LocalVolumeReplicaSnapshotStatus defines the observed state + of LocalVolumeReplicaSnapshot + properties: + allocatedCapacityBytes: + description: AllocatedCapacityBytes is the real allocated capacity + in bytes + format: int64 + type: integer + attr: + description: Attribute indicates attr on snapshot + properties: + invalid: + description: Invalid set true if snapshot is expiration + type: boolean + merging: + description: Merging set true if snapshot is merging now + type: boolean + type: object + creationTime: + description: CreationTime is the host real snapshot creation time + format: date-time + type: string + reason: + description: Message error message to describe some states + type: string + state: + description: State is the phase of volume replica, e.g. Creating, + Ready, NotReady, ToBeDeleted, Deleted + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumes_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumes_crd.yaml index cdc0d399..6b54c5e9 100644 --- a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumes_crd.yaml +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumes_crd.yaml @@ -37,6 +37,7 @@ spec: - description: Allocated resource ID for the volume jsonPath: .spec.config.resourceID name: resource + priority: 1 type: integer - description: Name of the node where the volume is in-use jsonPath: .status.publishedNode @@ -45,6 +46,12 @@ spec: - description: Filesystem type of this volume jsonPath: .status.fsType name: fstype + priority: 1 + type: string + - description: Name of volume group + jsonPath: .spec.volumegroup + name: group + priority: 1 type: string - jsonPath: .metadata.creationTimestamp name: age @@ -185,6 +192,16 @@ spec: format: int64 minimum: 4194304 type: integer + volumeQoS: + description: VolumeQoS is the QoS of the volume + properties: + iops: + description: IOPS defines the IOPS of the volume + type: string + throughput: + description: Throughput defines the throughput of the volume + type: string + type: object volumegroup: description: VolumeGroup is the group name of the local volumes. It is designed for the scheduling and allocating. @@ -226,7 +243,7 @@ spec: type: integer usedCapacityBytes: description: UsedCapacityBytes is the used capacity in bytes of the - volume, which is avaiable only for filesystem + volume, which is available only for filesystem format: int64 type: integer usedInode: diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshotrecovers_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshotrecovers_crd.yaml new file mode 100644 index 00000000..737ac31d --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshotrecovers_crd.yaml @@ -0,0 +1,105 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: localvolumesnapshotrecovers.hwameistor.io +spec: + group: hwameistor.io + names: + kind: LocalVolumeSnapshotRecover + listKind: LocalVolumeSnapshotRecoverList + plural: localvolumesnapshotrecovers + shortNames: + - lvsrecover + - lvsnaprecover + singular: localvolumesnapshotrecover + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Target for the recover + jsonPath: .spec.targetVolume + name: targetvolume + type: string + - description: Source snapshot for the recover + jsonPath: .spec.sourceVolumeSnapshot + name: sourcesnapshot + type: string + - description: State of the recover + jsonPath: .status.state + name: state + type: string + - jsonPath: .metadata.creationTimestamp + name: age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: LocalVolumeSnapshotRecover is user's request for either recovering + a local volume snapshot to a new volume, or merging into the old volume. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: LocalVolumeSnapshotRecoverSpec defines the desired state + of LocalVolumeSnapshotRecover + properties: + abort: + default: false + description: Abort can be used to abort the recover operation and + clean up sub resources created by the recover operation automatically + type: boolean + recoverType: + default: restore + description: RecoverType is the type about how to recover the volume, + e.g. rollback, restore. By default restore. + enum: + - rollback + - restore + type: string + sourceVolumeSnapshot: + description: SourceVolumeSnapshot represents which snapshot is used + for volume to recover from + type: string + targetPoolName: + description: TargetVolume is the name of the target volume will place + at + type: string + targetVolume: + description: TargetVolume is the name of the volume to recover to + type: string + required: + - recoverType + - sourceVolumeSnapshot + type: object + status: + description: LocalVolumeSnapshotRecoverStatus defines the observed state + of LocalVolumeSnapshotRecover + properties: + message: + description: Message error message to describe some states + type: string + state: + description: State is the phase of recover volume snapshot, e.g. submitted, + started, completed, abort, ... + type: string + volumeReplicaSnapshotRecover: + description: VolumeReplicaSnapshotRecover is the replica snapshot + to be recovered + items: + type: string + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshots_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshots_crd.yaml new file mode 100644 index 00000000..d99e6060 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_localvolumesnapshots_crd.yaml @@ -0,0 +1,151 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: localvolumesnapshots.hwameistor.io +spec: + group: hwameistor.io + names: + kind: LocalVolumeSnapshot + listKind: LocalVolumeSnapshotList + plural: localvolumesnapshots + shortNames: + - lvs + singular: localvolumesnapshot + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Required capacity of the volume snapshot + jsonPath: .status.allocatedCapacityBytes + name: Capacity + type: integer + - description: Name of the snapshot's source volume + jsonPath: .spec.sourceVolume + name: SourceVolume + type: string + - description: State of the snapshot + jsonPath: .status.state + name: State + type: string + - description: if the snapshot is merging + jsonPath: .status.attr.merging + name: Merging + type: string + - description: if the snapshot is invalid + jsonPath: .status.attr.invalid + name: Invalid + type: string + - jsonPath: .status.creationTime + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: LocalVolumeSnapshot is a user's request for either creating a + point-in-time snapshot of a persistent localvolume, or binding to a pre-existing + snapshot. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: LocalVolumeSnapshotSpec describes the common attributes of + a localvolume snapshot. + properties: + accessibility: + description: 'NOTE: We only take snapshots on the volume replica exist + at the moment! Accessibility is the topology requirement of the + volume snapshot. It describes how to locate and distribute the volume + replicas snapshot.' + properties: + nodes: + description: Nodes is the collection of storage nodes the volume + replicas must locate at + items: + type: string + type: array + regions: + default: + - default + description: regions where the volume replicas should be distributed + across, it's Optional + items: + type: string + type: array + zones: + default: + - default + description: zones where the volume replicas should be distributed + across, it's Optional + items: + type: string + type: array + type: object + delete: + default: false + type: boolean + requiredCapacityBytes: + description: RequiredCapacityBytes specifies the space reserved for + the snapshot + format: int64 + minimum: 4194304 + type: integer + sourceVolume: + description: SourceVolume specifies the source volume of the snapshot + type: string + required: + - accessibility + - requiredCapacityBytes + - sourceVolume + type: object + status: + description: LocalVolumeSnapshotStatus defines the observed state of LocalVolumeSnapshot + properties: + allocatedCapacityBytes: + description: AllocatedCapacityBytes is the real allocated capacity + in bytes In case of HA volume with multiple replicas, the value + is equal to the one of a replica's snapshot size + format: int64 + type: integer + attr: + description: Attribute indicates attr on snapshot + properties: + invalid: + description: Invalid set true if snapshot is expiration + type: boolean + merging: + description: Merging set true if snapshot is merging now + type: boolean + type: object + creationTime: + description: CreationTime is the host real snapshot creation time + In case of HA volume with multiple replicas, the value is equal + to the one of a replica's snapshot creation time + format: date-time + type: string + message: + description: Message error message to describe some states + type: string + replicaSnapshots: + description: ReplicaSnapshots represents the actual snapshots of replica + items: + type: string + type: array + state: + description: State is the phase of volume replica, e.g. Creating, + Ready, NotReady, ToBeDeleted, Deleted + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_resizepolicies_crd.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_resizepolicies_crd.yaml new file mode 100644 index 00000000..9b00fe91 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/hwameistor.io_resizepolicies_crd.yaml @@ -0,0 +1,193 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: resizepolicies.hwameistor.io +spec: + group: hwameistor.io + names: + kind: ResizePolicy + listKind: ResizePolicyList + plural: resizepolicies + singular: resizepolicy + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ResizePolicy is the Schema for the resizepolicies API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ResizePolicySpec defines the desired state of ResizePolicy + properties: + namespaceSelector: + description: A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + nodePoolUsageLimit: + type: integer + pvcSelector: + description: A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + resizeThreshold: + type: integer + storageClassSelector: + description: A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + warningThreshold: + type: integer + required: + - nodePoolUsageLimit + - resizeThreshold + - warningThreshold + type: object + status: + description: ResizePolicyStatus defines the observed state of ResizePolicy + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml new file mode 100644 index 00000000..fe53fd3b --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotclasses.yaml @@ -0,0 +1,86 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/665" + creationTimestamp: null + name: volumesnapshotclasses.snapshot.storage.k8s.io +spec: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshotClass + listKind: VolumeSnapshotClassList + plural: volumesnapshotclasses + shortNames: + - vsclass + - vsclasses + singular: volumesnapshotclass + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .driver + name: Driver + type: string + - description: Determines whether a VolumeSnapshotContent created through the + VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. + jsonPath: .deletionPolicy + name: DeletionPolicy + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + description: VolumeSnapshotClass specifies parameters that a underlying storage + system uses when creating a volume snapshot. A specific VolumeSnapshotClass + is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses + are non-namespaced + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + deletionPolicy: + description: deletionPolicy determines whether a VolumeSnapshotContent + created through the VolumeSnapshotClass should be deleted when its bound + VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". + "Retain" means that the VolumeSnapshotContent and its physical snapshot + on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent + and its physical snapshot on underlying storage system are deleted. + Required. + enum: + - Delete + - Retain + type: string + driver: + description: driver is the name of the storage driver that handles this + VolumeSnapshotClass. Required. + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + parameters: + additionalProperties: + type: string + description: parameters is a key-value map with storage driver specific + parameters for creating snapshots. These values are opaque to Kubernetes. + type: object + required: + - deletionPolicy + - driver + type: object + served: true + storage: true + subresources: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml new file mode 100644 index 00000000..30ee778f --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshotcontents.yaml @@ -0,0 +1,255 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/665" + creationTimestamp: null + name: volumesnapshotcontents.snapshot.storage.k8s.io +spec: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshotContent + listKind: VolumeSnapshotContentList + plural: volumesnapshotcontents + shortNames: + - vsc + - vscs + singular: volumesnapshotcontent + scope: Cluster + versions: + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + jsonPath: .status.readyToUse + name: ReadyToUse + type: boolean + - description: Represents the complete size of the snapshot in bytes + jsonPath: .status.restoreSize + name: RestoreSize + type: integer + - description: Determines whether this VolumeSnapshotContent and its physical + snapshot on the underlying storage system should be deleted when its bound + VolumeSnapshot is deleted. + jsonPath: .spec.deletionPolicy + name: DeletionPolicy + type: string + - description: Name of the CSI driver used to create the physical snapshot on + the underlying storage system. + jsonPath: .spec.driver + name: Driver + type: string + - description: Name of the VolumeSnapshotClass to which this snapshot belongs. + jsonPath: .spec.volumeSnapshotClassName + name: VolumeSnapshotClass + type: string + - description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent + object is bound. + jsonPath: .spec.volumeSnapshotRef.name + name: VolumeSnapshot + type: string + - description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. + jsonPath: .spec.volumeSnapshotRef.namespace + name: VolumeSnapshotNamespace + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + description: VolumeSnapshotContent represents the actual "on-disk" snapshot + object in the underlying storage system + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + spec: + description: spec defines properties of a VolumeSnapshotContent created + by the underlying storage system. Required. + properties: + deletionPolicy: + description: deletionPolicy determines whether this VolumeSnapshotContent + and its physical snapshot on the underlying storage system should + be deleted when its bound VolumeSnapshot is deleted. Supported values + are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent + and its physical snapshot on underlying storage system are kept. + "Delete" means that the VolumeSnapshotContent and its physical snapshot + on underlying storage system are deleted. For dynamically provisioned + snapshots, this field will automatically be filled in by the CSI + snapshotter sidecar with the "DeletionPolicy" field defined in the + corresponding VolumeSnapshotClass. For pre-existing snapshots, users + MUST specify this field when creating the VolumeSnapshotContent + object. Required. + enum: + - Delete + - Retain + type: string + driver: + description: driver is the name of the CSI driver used to create the + physical snapshot on the underlying storage system. This MUST be + the same as the name returned by the CSI GetPluginName() call for + that driver. Required. + type: string + source: + description: source specifies whether the snapshot is (or should be) + dynamically provisioned or already exists, and just requires a Kubernetes + object representation. This field is immutable after creation. Required. + properties: + snapshotHandle: + description: snapshotHandle specifies the CSI "snapshot_id" of + a pre-existing snapshot on the underlying storage system for + which a Kubernetes object representation was (or should be) + created. This field is immutable. + type: string + volumeHandle: + description: volumeHandle specifies the CSI "volume_id" of the + volume from which a snapshot should be dynamically taken from. + This field is immutable. + type: string + type: object + oneOf: + - required: ["snapshotHandle"] + - required: ["volumeHandle"] + sourceVolumeMode: + description: SourceVolumeMode is the mode of the volume whose snapshot + is taken. Can be either “Filesystem” or “Block”. If not specified, + it indicates the source volume's mode is unknown. This field is + immutable. This field is an alpha field. + type: string + volumeSnapshotClassName: + description: name of the VolumeSnapshotClass from which this snapshot + was (or will be) created. Note that after provisioning, the VolumeSnapshotClass + may be deleted or recreated with different set of values, and as + such, should not be referenced post-snapshot creation. + type: string + volumeSnapshotRef: + description: volumeSnapshotRef specifies the VolumeSnapshot object + to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName + field must reference to this VolumeSnapshotContent's name for the + bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent + object, name and namespace of the VolumeSnapshot object MUST be + provided for binding to happen. This field is immutable after creation. + Required. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - deletionPolicy + - driver + - source + - volumeSnapshotRef + type: object + status: + description: status represents the current information of a snapshot. + properties: + creationTime: + description: creationTime is the timestamp when the point-in-time + snapshot is taken by the underlying storage system. In dynamic snapshot + creation case, this field will be filled in by the CSI snapshotter + sidecar with the "creation_time" value returned from CSI "CreateSnapshot" + gRPC call. For a pre-existing snapshot, this field will be filled + with the "creation_time" value returned from the CSI "ListSnapshots" + gRPC call if the driver supports it. If not specified, it indicates + the creation time is unknown. The format of this field is a Unix + nanoseconds time encoded as an int64. On Unix, the command `date + +%s%N` returns the current time in nanoseconds since 1970-01-01 + 00:00:00 UTC. + format: int64 + type: integer + error: + description: error is the last observed error during snapshot creation, + if any. Upon success after retry, this error field will be cleared. + properties: + message: + description: 'message is a string detailing the encountered error + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + type: string + type: object + readyToUse: + description: readyToUse indicates if a snapshot is ready to be used + to restore a volume. In dynamic snapshot creation case, this field + will be filled in by the CSI snapshotter sidecar with the "ready_to_use" + value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "ready_to_use" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it, otherwise, this field will be set to "True". If not specified, + it means the readiness of a snapshot is unknown. + type: boolean + restoreSize: + description: restoreSize represents the complete size of the snapshot + in bytes. In dynamic snapshot creation case, this field will be + filled in by the CSI snapshotter sidecar with the "size_bytes" value + returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "size_bytes" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it. When restoring a volume from this snapshot, the size of the + volume MUST NOT be smaller than the restoreSize if it is specified, + otherwise the restoration will fail. If not specified, it indicates + that the size is unknown. + format: int64 + minimum: 0 + type: integer + snapshotHandle: + description: snapshotHandle is the CSI "snapshot_id" of a snapshot + on the underlying storage system. If not specified, it indicates + that dynamic snapshot creation has either failed or it is still + in progress. + type: string + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshots.yaml b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshots.yaml new file mode 100644 index 00000000..e98539c5 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/deploy/crds/snapshot.storage.k8s.io_volumesnapshots.yaml @@ -0,0 +1,204 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.8.0 + api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/665" + creationTimestamp: null + name: volumesnapshots.snapshot.storage.k8s.io +spec: + group: snapshot.storage.k8s.io + names: + kind: VolumeSnapshot + listKind: VolumeSnapshotList + plural: volumesnapshots + shortNames: + - vs + singular: volumesnapshot + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Indicates if the snapshot is ready to be used to restore a volume. + jsonPath: .status.readyToUse + name: ReadyToUse + type: boolean + - description: If a new snapshot needs to be created, this contains the name of + the source PVC from which this snapshot was (or will be) created. + jsonPath: .spec.source.persistentVolumeClaimName + name: SourcePVC + type: string + - description: If a snapshot already exists, this contains the name of the existing + VolumeSnapshotContent object representing the existing snapshot. + jsonPath: .spec.source.volumeSnapshotContentName + name: SourceSnapshotContent + type: string + - description: Represents the minimum size of volume required to rehydrate from + this snapshot. + jsonPath: .status.restoreSize + name: RestoreSize + type: string + - description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot. + jsonPath: .spec.volumeSnapshotClassName + name: SnapshotClass + type: string + - description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot + object intends to bind to. Please note that verification of binding actually + requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure + both are pointing at each other. Binding MUST be verified prior to usage of + this object. + jsonPath: .status.boundVolumeSnapshotContentName + name: SnapshotContent + type: string + - description: Timestamp when the point-in-time snapshot was taken by the underlying + storage system. + jsonPath: .status.creationTime + name: CreationTime + type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + description: VolumeSnapshot is a user's request for either creating a point-in-time + snapshot of a persistent volume, or binding to a pre-existing snapshot. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + spec: + description: 'spec defines the desired characteristics of a snapshot requested + by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots + Required.' + properties: + source: + description: source specifies where a snapshot will be created from. + This field is immutable after creation. Required. + properties: + persistentVolumeClaimName: + description: persistentVolumeClaimName specifies the name of the + PersistentVolumeClaim object representing the volume from which + a snapshot should be created. This PVC is assumed to be in the + same namespace as the VolumeSnapshot object. This field should + be set if the snapshot does not exists, and needs to be created. + This field is immutable. + type: string + volumeSnapshotContentName: + description: volumeSnapshotContentName specifies the name of a + pre-existing VolumeSnapshotContent object representing an existing + volume snapshot. This field should be set if the snapshot already + exists and only needs a representation in Kubernetes. This field + is immutable. + type: string + type: object + oneOf: + - required: ["persistentVolumeClaimName"] + - required: ["volumeSnapshotContentName"] + volumeSnapshotClassName: + description: 'VolumeSnapshotClassName is the name of the VolumeSnapshotClass + requested by the VolumeSnapshot. VolumeSnapshotClassName may be + left nil to indicate that the default SnapshotClass should be used. + A given cluster may have multiple default Volume SnapshotClasses: + one default per CSI Driver. If a VolumeSnapshot does not specify + a SnapshotClass, VolumeSnapshotSource will be checked to figure + out what the associated CSI Driver is, and the default VolumeSnapshotClass + associated with that CSI Driver will be used. If more than one VolumeSnapshotClass + exist for a given CSI Driver and more than one have been marked + as default, CreateSnapshot will fail and generate an event. Empty + string is not allowed for this field.' + type: string + required: + - source + type: object + status: + description: status represents the current information of a snapshot. + Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent + objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent + point at each other) before using this object. + properties: + boundVolumeSnapshotContentName: + description: 'boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent + object to which this VolumeSnapshot object intends to bind to. If + not specified, it indicates that the VolumeSnapshot object has not + been successfully bound to a VolumeSnapshotContent object yet. NOTE: + To avoid possible security issues, consumers must verify binding + between VolumeSnapshot and VolumeSnapshotContent objects is successful + (by validating that both VolumeSnapshot and VolumeSnapshotContent + point at each other) before using this object.' + type: string + creationTime: + description: creationTime is the timestamp when the point-in-time + snapshot is taken by the underlying storage system. In dynamic snapshot + creation case, this field will be filled in by the snapshot controller + with the "creation_time" value returned from CSI "CreateSnapshot" + gRPC call. For a pre-existing snapshot, this field will be filled + with the "creation_time" value returned from the CSI "ListSnapshots" + gRPC call if the driver supports it. If not specified, it may indicate + that the creation time of the snapshot is unknown. + format: date-time + type: string + error: + description: error is the last observed error during snapshot creation, + if any. This field could be helpful to upper level controllers(i.e., + application controller) to decide whether they should continue on + waiting for the snapshot to be created based on the type of error + reported. The snapshot controller will keep retrying when an error + occurs during the snapshot creation. Upon success, this error field + will be cleared. + properties: + message: + description: 'message is a string detailing the encountered error + during snapshot creation if specified. NOTE: message may be + logged, and it should not contain sensitive information.' + type: string + time: + description: time is the timestamp when the error was encountered. + format: date-time + type: string + type: object + readyToUse: + description: readyToUse indicates if the snapshot is ready to be used + to restore a volume. In dynamic snapshot creation case, this field + will be filled in by the snapshot controller with the "ready_to_use" + value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing + snapshot, this field will be filled with the "ready_to_use" value + returned from the CSI "ListSnapshots" gRPC call if the driver supports + it, otherwise, this field will be set to "True". If not specified, + it means the readiness of a snapshot is unknown. + type: boolean + restoreSize: + type: string + description: restoreSize represents the minimum size of volume required + to create a volume from this snapshot. In dynamic snapshot creation + case, this field will be filled in by the snapshot controller with + the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. + For a pre-existing snapshot, this field will be filled with the + "size_bytes" value returned from the CSI "ListSnapshots" gRPC call + if the driver supports it. When restoring a volume from this snapshot, + the size of the volume MUST NOT be smaller than the restoreSize + if it is specified, otherwise the restoration will fail. If not + specified, it indicates that the size is unknown. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/event.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/event.go new file mode 100644 index 00000000..70351679 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/event.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + scheme "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/scheme" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// EventsGetter has a method to return a EventInterface. +// A group's client should implement this interface. +type EventsGetter interface { + Events() EventInterface +} + +// EventInterface has methods to work with Event resources. +type EventInterface interface { + Create(ctx context.Context, event *v1alpha1.Event, opts v1.CreateOptions) (*v1alpha1.Event, error) + Update(ctx context.Context, event *v1alpha1.Event, opts v1.UpdateOptions) (*v1alpha1.Event, error) + UpdateStatus(ctx context.Context, event *v1alpha1.Event, opts v1.UpdateOptions) (*v1alpha1.Event, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Event, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EventList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Event, err error) + EventExpansion +} + +// events implements EventInterface +type events struct { + client rest.Interface +} + +// newEvents returns a Events +func newEvents(c *HwameistorV1alpha1Client) *events { + return &events{ + client: c.RESTClient(), + } +} + +// Get takes name of the event, and returns the corresponding event object, and an error if there is any. +func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Event, err error) { + result = &v1alpha1.Event{} + err = c.client.Get(). + Resource("events"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Events that match those selectors. +func (c *events) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.EventList{} + err = c.client.Get(). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested events. +func (c *events) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. +func (c *events) Create(ctx context.Context, event *v1alpha1.Event, opts v1.CreateOptions) (result *v1alpha1.Event, err error) { + result = &v1alpha1.Event{} + err = c.client.Post(). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(event). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. +func (c *events) Update(ctx context.Context, event *v1alpha1.Event, opts v1.UpdateOptions) (result *v1alpha1.Event, err error) { + result = &v1alpha1.Event{} + err = c.client.Put(). + Resource("events"). + Name(event.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(event). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *events) UpdateStatus(ctx context.Context, event *v1alpha1.Event, opts v1.UpdateOptions) (result *v1alpha1.Event, err error) { + result = &v1alpha1.Event{} + err = c.client.Put(). + Resource("events"). + Name(event.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(event). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the event and deletes it. Returns an error if one occurs. +func (c *events) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("events"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *events) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("events"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched event. +func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Event, err error) { + result = &v1alpha1.Event{} + err = c.client.Patch(pt). + Resource("events"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go index 95f549ca..3f1fa6f3 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go @@ -2,6 +2,8 @@ package v1alpha1 +type EventExpansion interface{} + type LocalDiskExpansion interface{} type LocalDiskClaimExpansion interface{} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go index 4e33a2f2..4c8aed18 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go @@ -10,6 +10,7 @@ import ( type HwameistorV1alpha1Interface interface { RESTClient() rest.Interface + EventsGetter LocalDisksGetter LocalDiskClaimsGetter LocalDiskNodesGetter @@ -28,6 +29,10 @@ type HwameistorV1alpha1Client struct { restClient rest.Interface } +func (c *HwameistorV1alpha1Client) Events() EventInterface { + return newEvents(c) +} + func (c *HwameistorV1alpha1Client) LocalDisks() LocalDiskInterface { return newLocalDisks(c) } diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/event.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/event.go new file mode 100644 index 00000000..8f450c7d --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/event.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + versioned "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned" + internalinterfaces "github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1" + hwameistorv1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EventInformer provides access to a shared informer and lister for +// Events. +type EventInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.EventLister +} + +type eventInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEventInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEventInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEventInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().Events().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().Events().Watch(context.TODO(), options) + }, + }, + &hwameistorv1alpha1.Event{}, + resyncPeriod, + indexers, + ) +} + +func (f *eventInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEventInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *eventInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&hwameistorv1alpha1.Event{}, f.defaultInformer) +} + +func (f *eventInformer) Lister() v1alpha1.EventLister { + return v1alpha1.NewEventLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go index 35630b20..ccc75e6b 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go @@ -8,6 +8,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // Events returns a EventInformer. + Events() EventInformer // LocalDisks returns a LocalDiskInformer. LocalDisks() LocalDiskInformer // LocalDiskClaims returns a LocalDiskClaimInformer. @@ -43,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// Events returns a EventInformer. +func (v *version) Events() EventInformer { + return &eventInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // LocalDisks returns a LocalDiskInformer. func (v *version) LocalDisks() LocalDiskInformer { return &localDiskInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/event.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/event.go new file mode 100644 index 00000000..c1179372 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/event.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// EventLister helps list Events. +type EventLister interface { + // List lists all Events in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.Event, err error) + // Get retrieves the Event from the index for a given name. + Get(name string) (*v1alpha1.Event, error) + EventListerExpansion +} + +// eventLister implements the EventLister interface. +type eventLister struct { + indexer cache.Indexer +} + +// NewEventLister returns a new EventLister. +func NewEventLister(indexer cache.Indexer) EventLister { + return &eventLister{indexer: indexer} +} + +// List lists all Events in the indexer. +func (s *eventLister) List(selector labels.Selector) (ret []*v1alpha1.Event, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Event)) + }) + return ret, err +} + +// Get retrieves the Event from the index for a given name. +func (s *eventLister) Get(name string) (*v1alpha1.Event, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("event"), name) + } + return obj.(*v1alpha1.Event), nil +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go index 8e95c4a0..dc4f72e5 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go @@ -2,6 +2,10 @@ package v1alpha1 +// EventListerExpansion allows custom methods to be added to +// EventLister. +type EventListerExpansion interface{} + // LocalDiskListerExpansion allows custom methods to be added to // LocalDiskLister. type LocalDiskListerExpansion interface{} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/event_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/event_types.go new file mode 100644 index 00000000..70282a19 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/event_types.go @@ -0,0 +1,82 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// EventSpec defines the desired state of Event +type EventSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html + + // HwameiStor resource type: Cluster, LocalStorageNode, LocalDiskNode, Pool, LocalVolume, LocalDiskVolume, LocalDisk, + // +kubebuilder:validation:Enum:=Cluster;StorageNode;DiskNode;Pool;Volume;DiskVolume;Disk + ResourceType string `json:"resourceType"` + + // Name of the resource + ResourceName string `json:"resourceName"` + + // Which node does the resource reside in + // NodeName string `json:"nodeName"` + + Records []EventRecord `json:"records"` +} + +type EventRecord struct { + // The time when does the action happen + Time metav1.Time `json:"time,omitempty"` + + // id is unique + ID string `json:"id,omitempty"` + + // The action is the operation on the resource, such as Migrate a LocalVolume + Action string `json:"action,omitempty"` + // The content of the action which is a JSON string + ActionContent string `json:"actionContent,omitempty"` + + // The state of the action + State string `json:"state,omitempty"` + // The content of the action state which is a JSON string + StateContent string `json:"stateContent,omitempty"` +} + +// EventStatus defines the observed state of Event +type EventStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Event is the Schema for the events API +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=events,scope=Cluster,shortName=evt +// +kubebuilder:printcolumn:JSONPath=".spec.resourceType",name=type,type=string +// +kubebuilder:printcolumn:JSONPath=".spec.resourceName",name=resource,type=string +type Event struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec EventSpec `json:"spec,omitempty"` + Status EventStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EventList contains a list of Event +type EventList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Event `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Event{}, &EventList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdisk_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdisk_types.go index 46193b0c..1af4d97b 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdisk_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdisk_types.go @@ -12,6 +12,22 @@ const ( LocalStorage = "local-storage" LocalDiskManager = "local-disk-manager" System = "system" + + // LocalDiskObjectPrefix is used to prefix LocalDisk objects + LocalDiskObjectPrefix = "localdisk-" +) + +type DevLinkType = string + +const ( + // LinkByPath is used to identify by-path symbolic link + LinkByPath DevLinkType = "by-path" + + // LinkByID is used to identify by-id symbolic link + LinkByID DevLinkType = "by-id" + + // LinkByUUID is used to identify by-uuid symbolic link + LinkByUUID DevLinkType = "by-uuid" ) // PartitionInfo contains partition information(e.g. FileSystem) @@ -157,12 +173,21 @@ type LocalDiskSpec struct { // +kubebuilder:validation:Required NodeName string `json:"nodeName"` + // PreNodeName represents the node where the disk was attached + PreNodeName string `json:"preNodeName,omitempty"` + // UUID global unique identifier of the disk UUID string `json:"uuid,omitempty"` // DevicePath is the disk path in the OS DevicePath string `json:"devicePath,omitempty"` + // PreDevicePath represents the last device path in the OS + PreDevicePath string `json:"preDevicePath,omitempty"` + + // DevLinks are symbol links for this device + DevLinks []string `json:"devLinks"` + // Capacity of the disk in bytes Capacity int64 `json:"capacity,omitempty"` @@ -205,6 +230,14 @@ type LocalDiskSpec struct { // Owner represents which system owns this claim(e.g. local-storage, local-disk-manager) // +optional Owner string `json:"owner,omitempty"` + + // Major represents drive used by the device + // +optional + Major string `json:"major,omitempty"` + + // Minor is used to distinguish different devices + // +optional + Minor string `json:"minor,omitempty"` } // LocalDiskStatus defines the observed state of LocalDisk @@ -219,13 +252,19 @@ type LocalDiskStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalDisk is the Schema for the localdisks API -//+kubebuilder:resource:scope=Cluster,shortName=ld -//+kubebuilder:subresource:status -//+kubebuilder:printcolumn:JSONPath=".spec.nodeName",name=NodeMatch,type=string -//+kubebuilder:printcolumn:JSONPath=".spec.owner",name=Owner,type=string,priority=1 -//+kubebuilder:printcolumn:JSONPath=".status.claimState",name=Phase,type=string -//+kubebuilder:printcolumn:JSONPath=".spec.smartInfo.overallHealth",name=Health,type=string,priority=1 -//+kubebuilder:printcolumn:JSONPath=".spec.reserved",name=Reserved,type=boolean,priority=1 +// +kubebuilder:resource:scope=Cluster,shortName=ld +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:JSONPath=".spec.nodeName",name=NodeMatch,type=string +// +kubebuilder:printcolumn:JSONPath=".spec.capacity",name=Capacity,type=integer,priority=1 +// +kubebuilder:printcolumn:JSONPath=".spec.preNodeName",name=PreNodeMatch,type=string,priority=1 +// +kubebuilder:printcolumn:JSONPath=".spec.devicePath",name=DevicePath,type=string +// +kubebuilder:printcolumn:JSONPath=".spec.preDevicePath",name=PreDevicePath,type=string,priority=1 +// +kubebuilder:printcolumn:JSONPath=".spec.owner",name=Owner,type=string,priority=1 +// +kubebuilder:printcolumn:JSONPath=".status.claimState",name=Phase,type=string +// +kubebuilder:printcolumn:JSONPath=".spec.smartInfo.overallHealth",name=Health,type=string,priority=1 +// +kubebuilder:printcolumn:JSONPath=".spec.reserved",name=Reserved,type=boolean,priority=1 +// +kubebuilder:printcolumn:JSONPath=".spec.state",name=State,type=string +// +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp` type LocalDisk struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskclaim_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskclaim_types.go index f142346d..132866a2 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskclaim_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskclaim_types.go @@ -23,7 +23,8 @@ type LocalDiskClaimSpec struct { DiskRefs []*v1.ObjectReference `json:"diskRefs,omitempty"` // Owner represents which system owns this claim(e.g. local-storage, local-disk-manager) - Owner string `json:"owner,omitempty"` + // +kubebuilder:validation:Required + Owner string `json:"owner"` } type LocalDiskClaimSpecArray []LocalDiskClaimSpec diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskvolume_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskvolume_types.go index b35cea08..7ba5e18e 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskvolume_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localdiskvolume_types.go @@ -82,6 +82,12 @@ type LocalDiskVolumeStatus struct { // DevPath is the disk path in the OS DevPath string `json:"devPath"` + // VolumePath is the volume path in the OS + VolumePath string `json:"volumePath,omitempty"` + + // DevLinks is the set of symlink of a disk + DevLinks map[DevLinkType][]string `json:"devLinks,omitempty"` + // AllocatedCapacityBytes is the real allocated capacity in bytes AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"` diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolume_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolume_types.go index eef18204..84fbd8c7 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolume_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolume_types.go @@ -14,6 +14,9 @@ type LocalVolumeSpec struct { // +kubebuilder:validation:Minimum:=4194304 RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"` + // VolumeQoS is the QoS of the volume + VolumeQoS VolumeQoS `json:"volumeQoS,omitempty"` + // PoolName is the name of the storage pool, e.g. LocalStorage_PoolHDD, LocalStorage_PoolSSD, etc.. PoolName string `json:"poolName,omitempty"` @@ -50,6 +53,14 @@ type LocalVolumeSpec struct { Delete bool `json:"delete,omitempty"` } +// VolumeQoS is the QoS of the volume +type VolumeQoS struct { + // Throughput defines the throughput of the volume + Throughput string `json:"throughput,omitempty"` + // IOPS defines the IOPS of the volume + IOPS string `json:"iops,omitempty"` +} + // AccessibilityTopology of the volume type AccessibilityTopology struct { // Nodes is the collection of storage nodes the volume replicas must locate at @@ -64,6 +75,55 @@ type AccessibilityTopology struct { Regions []string `json:"regions,omitempty"` } +func (at *AccessibilityTopology) Equal(peer *AccessibilityTopology) bool { + + if !IsStringArraysEqual(at.Nodes, peer.Nodes) { + return false + } + if !IsStringArraysEqual(at.Zones, peer.Zones) { + return false + } + if !IsStringArraysEqual(at.Regions, peer.Regions) { + return false + } + + return true +} + +func IsStringArraysEqual(arr1, arr2 []string) bool { + if len(arr1) != len(arr2) { + return false + } + + for _, str1 := range arr1 { + found := false + for _, str2 := range arr2 { + if str1 == str2 { + found = true + break + } + } + if !found { + return false + } + } + + for _, str2 := range arr2 { + found := false + for _, str1 := range arr1 { + if str2 == str1 { + found = true + break + } + } + if !found { + return false + } + } + + return true +} + // VolumeConfig is the configration of the volume, including the replicas type VolumeConfig struct { // Version of config, start from 0, plus 1 every time config update @@ -196,9 +256,10 @@ type LocalVolumeStatus struct { // +kubebuilder:printcolumn:name="capacity",type=integer,JSONPath=`.spec.requiredCapacityBytes`,description="Required capacity of the volume" // +kubebuilder:printcolumn:name="used",type=integer,JSONPath=`.status.usedCapacityBytes`,description="Used capacity of the volume" // +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the volume" -// +kubebuilder:printcolumn:name="resource",type=integer,JSONPath=`.spec.config.resourceID`,description="Allocated resource ID for the volume" +// +kubebuilder:printcolumn:name="resource",type=integer,JSONPath=`.spec.config.resourceID`,description="Allocated resource ID for the volume",priority=1 // +kubebuilder:printcolumn:name="published",type=string,JSONPath=`.status.publishedNode`,description="Name of the node where the volume is in-use" -// +kubebuilder:printcolumn:name="fstype",type=string,JSONPath=`.status.fsType`,description="Filesystem type of this volume" +// +kubebuilder:printcolumn:name="fstype",type=string,JSONPath=`.status.fsType`,description="Filesystem type of this volume",priority=1 +// +kubebuilder:printcolumn:name="group",type=string,JSONPath=`.spec.volumegroup`,description="Name of volume group",priority=1 // +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp` type LocalVolume struct { metav1.TypeMeta `json:",inline"` @@ -216,6 +277,14 @@ func (v *LocalVolume) SetReplicas(replicas []*LocalVolumeReplica) { } } +// UpdateAccessibilityNodesFromReplicas Update volume and group's accessibility node by replicas +func (v *LocalVolume) UpdateAccessibilityNodesFromReplicas() { + v.Spec.Accessibility.Nodes = make([]string, 0) + for _, replica := range v.Spec.Config.Replicas { + v.Spec.Accessibility.Nodes = append(v.Spec.Accessibility.Nodes, replica.Hostname) + } +} + // IsHighAvailability return true if volume is HighAvailability func (v *LocalVolume) IsHighAvailability() bool { return v.Spec.ReplicaNumber >= 2 diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumegroup_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumegroup_types.go index 382a9b48..74a12b93 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumegroup_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumegroup_types.go @@ -67,6 +67,12 @@ type LocalVolumeGroupList struct { Items []LocalVolumeGroup `json:"items"` } +// SetAccessibilityNodes Set group's accessibility node +func (c *LocalVolumeGroup) SetAccessibilityNodes(nodes []string) { + c.Spec.Accessibility.Nodes = make([]string, len(nodes)) + copy(c.Spec.Accessibility.Nodes, nodes) +} + func init() { SchemeBuilder.Register(&LocalVolumeGroup{}, &LocalVolumeGroupList{}) } diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplica_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplica_types.go index 50e3e0e0..85a5a6e7 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplica_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplica_types.go @@ -23,6 +23,9 @@ type LocalVolumeReplicaSpec struct { // +kubebuilder:validation:Minimum:=4194304 RequiredCapacityBytes int64 `json:"requiredCapacityBytes,omitempty"` + // VolumeQoS is the QoS of the volume + VolumeQoS VolumeQoS `json:"volumeQoS,omitempty"` + // Delete is to indicate where the replica should be deleted or not. // It's different from the regular resource delete interface in Kubernetes. // The purpose is to protect it from any mistakes diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshot_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshot_types.go new file mode 100644 index 00000000..80bb54c9 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshot_types.go @@ -0,0 +1,101 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LocalVolumeReplicaSnapshotSpec represents the actual localvolume snapshot object in lvm +type LocalVolumeReplicaSnapshotSpec struct { + // NodeName specifies which node the snapshot will be placed + // +kubebuilder:validation:Required + NodeName string `json:"nodeName"` + + // VolumeSnapshotName represents the name of volume snapshot + // +kubebuilder:validation:Required + VolumeSnapshotName string `json:"volumeSnapshotName"` + + // SourceVolume specifies the source volume name of the snapshot + // +kubebuilder:validation:Required + SourceVolume string `json:"sourceVolume"` + + // SourceVolume specifies the source volume replica name of the snapshot + // +kubebuilder:validation:Required + SourceVolumeReplica string `json:"sourceVolumeReplica"` + + // PoolName specifies which volume group the snapshot and source volume is placed + // valid options are LocalStorage_PoolHDD, LocalStorage_PoolSSD, LocalStorage_PoolNVMe + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum:=LocalStorage_PoolHDD;LocalStorage_PoolSSD;LocalStorage_PoolNVMe + PoolName string `json:"poolName"` + + // RequiredCapacityBytes specifies the space reserved for the snapshot + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum:=4194304 + RequiredCapacityBytes int64 `json:"requiredCapacityBytes"` + + // Delete this snapshot if it is true + // +kubebuilder:default:=false + Delete bool `json:"delete,omitempty"` +} + +// LocalVolumeReplicaSnapshotStatus defines the observed state of LocalVolumeReplicaSnapshot +type LocalVolumeReplicaSnapshotStatus struct { + // AllocatedCapacityBytes is the real allocated capacity in bytes + AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"` + + // CreationTime is the host real snapshot creation time + CreationTime *metav1.Time `json:"creationTime,omitempty"` + + // Attribute indicates attr on snapshot + Attribute VolumeSnapshotAttr `json:"attr,omitempty"` + + // State is the phase of volume replica, e.g. Creating, Ready, NotReady, ToBeDeleted, Deleted + State State `json:"state,omitempty"` + + // Message error message to describe some states + Message string `json:"reason,omitempty"` +} + +// VolumeSnapshotAttr defines attrs of volume, e.g. invalid, merging... +type VolumeSnapshotAttr struct { + // Merging set true if snapshot is merging now + Merging bool `json:"merging,omitempty"` + + // Invalid set true if snapshot is expiration + Invalid bool `json:"invalid,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeReplicaSnapshot is the Schema for the localvolumereplicasnapshots API +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=localvolumereplicasnapshots,scope=Cluster,shortName=lvrs +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Capacity",type=integer,JSONPath=`.status.allocatedCapacityBytes`,description="Allocated capacity of the snapshot" +// +kubebuilder:printcolumn:name="NodeName",type=string,JSONPath=`.spec.nodeName`,description="Node where snapshot is located" +// +kubebuilder:printcolumn:name="SourceVolume",type=string,JSONPath=`.spec.sourceVolume`,description="Name of the snapshot's source volume" +// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="State of the snapshot" +// +kubebuilder:printcolumn:name="Merging",type=string,JSONPath=`.status.attr.merging`,description="if the snapshot is merging" +// +kubebuilder:printcolumn:name="Invalid",type=string,JSONPath=`.status.attr.invalid`,description="if the snapshot is invalid" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.status.creationTime` +// +kubebuilder:printcolumn:name="SourceVolumeReplica",type=string,JSONPath=`.spec.sourceVolumeReplica`,description="Name of the snapshot's source volume replica",priority=1 +type LocalVolumeReplicaSnapshot struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LocalVolumeReplicaSnapshotSpec `json:"spec,omitempty"` + Status LocalVolumeReplicaSnapshotStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeReplicaSnapshotList contains a list of LocalVolumeReplicaSnapshot +type LocalVolumeReplicaSnapshotList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LocalVolumeReplicaSnapshot `json:"items"` +} + +func init() { + SchemeBuilder.Register(&LocalVolumeReplicaSnapshot{}, &LocalVolumeReplicaSnapshotList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshotrecover_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshotrecover_types.go new file mode 100644 index 00000000..15ff1951 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumereplicasnapshotrecover_types.go @@ -0,0 +1,84 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// LocalVolumeReplicaSnapshotRecoverSpec defines the desired state of LocalVolumeReplicaSnapshotRecover +type LocalVolumeReplicaSnapshotRecoverSpec struct { + // NodeName is the name of the node that snapshot will be recovered at + // +kubebuilder:validation:Required + NodeName string `json:"nodeName"` + + // TargetVolume is the name of the volume to recover to + // +kubebuilder:validation:Required + TargetVolume string `json:"targetVolume"` + + // TargetVolume is the name of the target volume will place at + // +kubebuilder:validation:Required + TargetPoolName string `json:"targetPoolName"` + + // SourceVolumeSnapshot represents which snapshot is used for volume to recover from + // +kubebuilder:validation:Required + SourceVolumeSnapshot string `json:"sourceVolumeSnapshot"` + + // SourceVolumeReplicaSnapshot represents which replica snapshot is used for volume to recover from + // +kubebuilder:validation:Required + SourceVolumeReplicaSnapshot string `json:"sourceVolumeReplicaSnapshot"` + + // RecoverType is the type about how to recover the volume, e.g. rollback, restore. By default restore. + // +kubebuilder:default:=restore + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum:=rollback;restore + RecoverType RecoverType `json:"recoverType"` + + // +kubebuilder:validation:Required + VolumeSnapshotRecover string `json:"volumeSnapshotRecover"` + + // Abort can be used to abort the recover operation and clean up sub resources created by the recover operation automatically + // +kubebuilder:default:=false + Abort bool `json:"abort,omitempty"` +} + +// LocalVolumeReplicaSnapshotRecoverStatus defines the observed state of LocalVolumeReplicaSnapshotRecover +type LocalVolumeReplicaSnapshotRecoverStatus struct { + // State is the phase of recover volume snapshot, e.g. submitted, started, completed, abort, ... + State State `json:"state,omitempty"` + + // Message error message to describe some states + Message string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeReplicaSnapshotRecover is the Schema for the localvolumereplicasnapshotrecovers API +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=localvolumereplicasnapshotrecovers,scope=Cluster,shortName=lvrsrecover;lvrsnaprecover +// +kubebuilder:printcolumn:name="nodeName",type=string,JSONPath=`.spec.nodeName`,description="Node to recover" +// +kubebuilder:printcolumn:name="targetvolume",type=string,JSONPath=`.spec.targetVolume`,description="Target for the recover" +// +kubebuilder:printcolumn:name="sourcesnapshot",type=string,JSONPath=`.spec.sourceVolumeSnapshot`,description="Source snapshot for the recover" +// +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the recover" +// +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp` +type LocalVolumeReplicaSnapshotRecover struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LocalVolumeReplicaSnapshotRecoverSpec `json:"spec,omitempty"` + Status LocalVolumeReplicaSnapshotRecoverStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeReplicaSnapshotRecoverList contains a list of LocalVolumeReplicaSnapshotRecover +type LocalVolumeReplicaSnapshotRecoverList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LocalVolumeReplicaSnapshotRecover `json:"items"` +} + +func init() { + SchemeBuilder.Register(&LocalVolumeReplicaSnapshotRecover{}, &LocalVolumeReplicaSnapshotRecoverList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go new file mode 100644 index 00000000..dd0a7a32 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go @@ -0,0 +1,87 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + SnapshotRecoveringFinalizer = "provisioner.hwameistor.io/recovering-protection" +) + +// VolumeSnapshotSpec describes the common attributes of a volume snapshot. + +// LocalVolumeSnapshotSpec describes the common attributes of a localvolume snapshot. +type LocalVolumeSnapshotSpec struct { + // SourceVolume specifies the source volume of the snapshot + // +kubebuilder:validation:Required + SourceVolume string `json:"sourceVolume"` + + // NOTE: We only take snapshots on the volume replica exist at the moment! + // Accessibility is the topology requirement of the volume snapshot. It describes how to locate and distribute the volume replicas snapshot. + Accessibility AccessibilityTopology `json:"accessibility"` + + // RequiredCapacityBytes specifies the space reserved for the snapshot + // +kubebuilder:validation:Required + // +kubebuilder:validation:Minimum:=4194304 + RequiredCapacityBytes int64 `json:"requiredCapacityBytes"` + + // +kubebuilder:default:=false + Delete bool `json:"delete,omitempty"` +} + +// LocalVolumeSnapshotStatus defines the observed state of LocalVolumeSnapshot +type LocalVolumeSnapshotStatus struct { + // AllocatedCapacityBytes is the real allocated capacity in bytes + // In case of HA volume with multiple replicas, the value is equal to the one of a replica's snapshot size + AllocatedCapacityBytes int64 `json:"allocatedCapacityBytes,omitempty"` + + // ReplicaSnapshots represents the actual snapshots of replica + ReplicaSnapshots []string `json:"replicaSnapshots,omitempty"` + + // CreationTime is the host real snapshot creation time + // In case of HA volume with multiple replicas, the value is equal to the one of a replica's snapshot creation time + CreationTime *metav1.Time `json:"creationTime,omitempty"` + + // Attribute indicates attr on snapshot + Attribute VolumeSnapshotAttr `json:"attr,omitempty"` + + // State is the phase of volume replica, e.g. Creating, Ready, NotReady, ToBeDeleted, Deleted + State State `json:"state,omitempty"` + + // Message error message to describe some states + Message string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeSnapshot is a user's request for either creating a point-in-time +// snapshot of a persistent localvolume, or binding to a pre-existing snapshot. +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=localvolumesnapshots,scope=Cluster,shortName=lvs +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Capacity",type=integer,JSONPath=`.status.allocatedCapacityBytes`,description="Required capacity of the volume snapshot" +// +kubebuilder:printcolumn:name="SourceVolume",type=string,JSONPath=`.spec.sourceVolume`,description="Name of the snapshot's source volume" +// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="State of the snapshot" +// +kubebuilder:printcolumn:name="Merging",type=string,JSONPath=`.status.attr.merging`,description="if the snapshot is merging" +// +kubebuilder:printcolumn:name="Invalid",type=string,JSONPath=`.status.attr.invalid`,description="if the snapshot is invalid" +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.status.creationTime` +type LocalVolumeSnapshot struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LocalVolumeSnapshotSpec `json:"spec,omitempty"` + Status LocalVolumeSnapshotStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeSnapshotList contains a list of LocalVolumeSnapshot +type LocalVolumeSnapshotList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LocalVolumeSnapshot `json:"items"` +} + +func init() { + SchemeBuilder.Register(&LocalVolumeSnapshot{}, &LocalVolumeSnapshotList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrecover_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrecover_types.go new file mode 100644 index 00000000..43102913 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrecover_types.go @@ -0,0 +1,78 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +const ( + SourceVolumeSnapshotAnnoKey = "hwameistor.io/source-snapshot" + VolumeSnapshotRecoverCompletedAnnoKey = "hwameistor.io/snapshot-recover-completed" +) + +// LocalVolumeSnapshotRecoverSpec defines the desired state of LocalVolumeSnapshotRecover +type LocalVolumeSnapshotRecoverSpec struct { + // TargetVolume is the name of the volume to recover to + TargetVolume string `json:"targetVolume,omitempty"` + + // TargetVolume is the name of the target volume will place at + TargetPoolName string `json:"targetPoolName,omitempty"` + + // SourceVolumeSnapshot represents which snapshot is used for volume to recover from + // +kubebuilder:validation:Required + SourceVolumeSnapshot string `json:"sourceVolumeSnapshot"` + + // RecoverType is the type about how to recover the volume, e.g. rollback, restore. By default restore. + // +kubebuilder:default:=restore + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum:=rollback;restore + RecoverType RecoverType `json:"recoverType"` + + // Abort can be used to abort the recover operation and clean up sub resources created by the recover operation automatically + // +kubebuilder:default:=false + Abort bool `json:"abort,omitempty"` +} + +// LocalVolumeSnapshotRecoverStatus defines the observed state of LocalVolumeSnapshotRecover +type LocalVolumeSnapshotRecoverStatus struct { + // VolumeReplicaSnapshotRecover is the replica snapshot to be recovered + VolumeReplicaSnapshotRecover []string `json:"volumeReplicaSnapshotRecover,omitempty"` + + // State is the phase of recover volume snapshot, e.g. submitted, started, completed, abort, ... + State State `json:"state,omitempty"` + + // Message error message to describe some states + Message string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeSnapshotRecover is user's request for either recovering a local volume snapshot to a new volume, or merging into the old volume. +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=localvolumesnapshotrecovers,scope=Cluster,shortName=lvsrecover;lvsnaprecover +// +kubebuilder:printcolumn:name="targetvolume",type=string,JSONPath=`.spec.targetVolume`,description="Target for the recover" +// +kubebuilder:printcolumn:name="sourcesnapshot",type=string,JSONPath=`.spec.sourceVolumeSnapshot`,description="Source snapshot for the recover" +// +kubebuilder:printcolumn:name="state",type=string,JSONPath=`.status.state`,description="State of the recover" +// +kubebuilder:printcolumn:name="age",type=date,JSONPath=`.metadata.creationTimestamp` +type LocalVolumeSnapshotRecover struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec LocalVolumeSnapshotRecoverSpec `json:"spec,omitempty"` + Status LocalVolumeSnapshotRecoverStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// LocalVolumeSnapshotRecoverList contains a list of LocalVolumeSnapshotRecover +type LocalVolumeSnapshotRecoverList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []LocalVolumeSnapshotRecover `json:"items"` +} + +func init() { + SchemeBuilder.Register(&LocalVolumeSnapshotRecover{}, &LocalVolumeSnapshotRecoverList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/resizepolicy_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/resizepolicy_types.go new file mode 100644 index 00000000..4e1148eb --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/resizepolicy_types.go @@ -0,0 +1,61 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// ResizePolicySpec defines the desired state of ResizePolicy +type ResizePolicySpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html + + WarningThreshold int8 `json:"warningThreshold"` + + ResizeThreshold int8 `json:"resizeThreshold"` + + NodePoolUsageLimit int8 `json:"nodePoolUsageLimit"` + + StorageClassSelector *metav1.LabelSelector `json:"storageClassSelector,omitempty"` + + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + + PVCSelector *metav1.LabelSelector `json:"pvcSelector,omitempty"` + +} + +// ResizePolicyStatus defines the observed state of ResizePolicy +type ResizePolicyStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResizePolicy is the Schema for the resizepolicies API +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=resizepolicies,scope=Cluster +type ResizePolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ResizePolicySpec `json:"spec,omitempty"` + Status ResizePolicyStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ResizePolicyList contains a list of ResizePolicy +type ResizePolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ResizePolicy `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ResizePolicy{}, &ResizePolicyList{}) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/types.go index f3650069..68ff169a 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/types.go @@ -112,6 +112,25 @@ const ( VolumeParameterReplicaNumberKey = "replicaNumber" VolumeParameterFSTypeKey = "csi.storage.k8s.io/fstype" VolumeParameterConvertible = "convertible" + VolumeParameterThroughput = "provision-throughput-on-creation" + VolumeParameterIOPS = "provision-iops-on-creation" +) + +// consts for snapshot class + +const ( + SnapshotParameterSizeKey = "snapsize" +) + +type RecoverType string + +// consts for snapshot restore + +const ( + // RecoverTypeRollback is used to merge snapshot to existing volume + RecoverTypeRollback RecoverType = "rollback" + // RecoverTypeRestore is used to create a new volume from existing snapshot + RecoverTypeRestore RecoverType = "restore" ) // misc @@ -128,7 +147,7 @@ const ( // localstorage local storage dev paths const ( - DiskDevRootPath = "/dev" + DiskDevRootPath = "/etc/hwameistor" AssigedDiskPool = DiskDevRootPath + "/LocalStorage_DiskPool" AssigedDiskPoolHDD = AssigedDiskPool + DiskClassNameHDD AssigedDiskPoolSSD = AssigedDiskPool + DiskClassNameSSD diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/zz_generated.deepcopy.go index 3ba4fde9..97cb4997 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/zz_generated.deepcopy.go @@ -1,11 +1,13 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated -// Code generated by operator-sdk. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -104,6 +106,123 @@ func (in *DiskClaimDescription) DeepCopy() *DiskClaimDescription { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Event) DeepCopyInto(out *Event) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Event. +func (in *Event) DeepCopy() *Event { + if in == nil { + return nil + } + out := new(Event) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Event) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventList) DeepCopyInto(out *EventList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Event, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventList. +func (in *EventList) DeepCopy() *EventList { + if in == nil { + return nil + } + out := new(EventList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EventList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventRecord) DeepCopyInto(out *EventRecord) { + *out = *in + in.Time.DeepCopyInto(&out.Time) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventRecord. +func (in *EventRecord) DeepCopy() *EventRecord { + if in == nil { + return nil + } + out := new(EventRecord) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventSpec) DeepCopyInto(out *EventSpec) { + *out = *in + if in.Records != nil { + in, out := &in.Records, &out.Records + *out = make([]EventRecord, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSpec. +func (in *EventSpec) DeepCopy() *EventSpec { + if in == nil { + return nil + } + out := new(EventSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventStatus) DeepCopyInto(out *EventStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventStatus. +func (in *EventStatus) DeepCopy() *EventStatus { + if in == nil { + return nil + } + out := new(EventStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FileSystemInfo) DeepCopyInto(out *FileSystemInfo) { *out = *in @@ -467,6 +586,11 @@ func (in *LocalDiskNodeStatus) DeepCopy() *LocalDiskNodeStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalDiskSpec) DeepCopyInto(out *LocalDiskSpec) { *out = *in + if in.DevLinks != nil { + in, out := &in.DevLinks, &out.DevLinks + *out = make([]string, len(*in)) + copy(*out, *in) + } if in.PartitionInfo != nil { in, out := &in.PartitionInfo, &out.PartitionInfo *out = make([]PartitionInfo, len(*in)) @@ -590,6 +714,21 @@ func (in *LocalDiskVolumeSpec) DeepCopy() *LocalDiskVolumeSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalDiskVolumeStatus) DeepCopyInto(out *LocalDiskVolumeStatus) { *out = *in + if in.DevLinks != nil { + in, out := &in.DevLinks, &out.DevLinks + *out = make(map[string][]string, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make([]string, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } if in.MountPoints != nil { in, out := &in.MountPoints, &out.MountPoints *out = make([]MountPoint, len(*in)) @@ -1276,9 +1415,201 @@ func (in *LocalVolumeReplicaList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshot) DeepCopyInto(out *LocalVolumeReplicaSnapshot) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshot. +func (in *LocalVolumeReplicaSnapshot) DeepCopy() *LocalVolumeReplicaSnapshot { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshot) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeReplicaSnapshot) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotList) DeepCopyInto(out *LocalVolumeReplicaSnapshotList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalVolumeReplicaSnapshot, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotList. +func (in *LocalVolumeReplicaSnapshotList) DeepCopy() *LocalVolumeReplicaSnapshotList { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeReplicaSnapshotList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotRecover) DeepCopyInto(out *LocalVolumeReplicaSnapshotRecover) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotRecover. +func (in *LocalVolumeReplicaSnapshotRecover) DeepCopy() *LocalVolumeReplicaSnapshotRecover { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotRecover) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeReplicaSnapshotRecover) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotRecoverList) DeepCopyInto(out *LocalVolumeReplicaSnapshotRecoverList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalVolumeReplicaSnapshotRecover, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotRecoverList. +func (in *LocalVolumeReplicaSnapshotRecoverList) DeepCopy() *LocalVolumeReplicaSnapshotRecoverList { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotRecoverList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeReplicaSnapshotRecoverList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotRecoverSpec) DeepCopyInto(out *LocalVolumeReplicaSnapshotRecoverSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotRecoverSpec. +func (in *LocalVolumeReplicaSnapshotRecoverSpec) DeepCopy() *LocalVolumeReplicaSnapshotRecoverSpec { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotRecoverSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotRecoverStatus) DeepCopyInto(out *LocalVolumeReplicaSnapshotRecoverStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotRecoverStatus. +func (in *LocalVolumeReplicaSnapshotRecoverStatus) DeepCopy() *LocalVolumeReplicaSnapshotRecoverStatus { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotRecoverStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotSpec) DeepCopyInto(out *LocalVolumeReplicaSnapshotSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotSpec. +func (in *LocalVolumeReplicaSnapshotSpec) DeepCopy() *LocalVolumeReplicaSnapshotSpec { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeReplicaSnapshotStatus) DeepCopyInto(out *LocalVolumeReplicaSnapshotStatus) { + *out = *in + if in.CreationTime != nil { + in, out := &in.CreationTime, &out.CreationTime + *out = (*in).DeepCopy() + } + out.Attribute = in.Attribute + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeReplicaSnapshotStatus. +func (in *LocalVolumeReplicaSnapshotStatus) DeepCopy() *LocalVolumeReplicaSnapshotStatus { + if in == nil { + return nil + } + out := new(LocalVolumeReplicaSnapshotStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalVolumeReplicaSpec) DeepCopyInto(out *LocalVolumeReplicaSpec) { *out = *in + out.VolumeQoS = in.VolumeQoS return } @@ -1318,9 +1649,212 @@ func (in *LocalVolumeReplicaStatus) DeepCopy() *LocalVolumeReplicaStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshot) DeepCopyInto(out *LocalVolumeSnapshot) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshot. +func (in *LocalVolumeSnapshot) DeepCopy() *LocalVolumeSnapshot { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshot) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeSnapshot) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotList) DeepCopyInto(out *LocalVolumeSnapshotList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalVolumeSnapshot, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotList. +func (in *LocalVolumeSnapshotList) DeepCopy() *LocalVolumeSnapshotList { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeSnapshotList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotRecover) DeepCopyInto(out *LocalVolumeSnapshotRecover) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotRecover. +func (in *LocalVolumeSnapshotRecover) DeepCopy() *LocalVolumeSnapshotRecover { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotRecover) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeSnapshotRecover) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotRecoverList) DeepCopyInto(out *LocalVolumeSnapshotRecoverList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LocalVolumeSnapshotRecover, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotRecoverList. +func (in *LocalVolumeSnapshotRecoverList) DeepCopy() *LocalVolumeSnapshotRecoverList { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotRecoverList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LocalVolumeSnapshotRecoverList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotRecoverSpec) DeepCopyInto(out *LocalVolumeSnapshotRecoverSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotRecoverSpec. +func (in *LocalVolumeSnapshotRecoverSpec) DeepCopy() *LocalVolumeSnapshotRecoverSpec { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotRecoverSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotRecoverStatus) DeepCopyInto(out *LocalVolumeSnapshotRecoverStatus) { + *out = *in + if in.VolumeReplicaSnapshotRecover != nil { + in, out := &in.VolumeReplicaSnapshotRecover, &out.VolumeReplicaSnapshotRecover + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotRecoverStatus. +func (in *LocalVolumeSnapshotRecoverStatus) DeepCopy() *LocalVolumeSnapshotRecoverStatus { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotRecoverStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotSpec) DeepCopyInto(out *LocalVolumeSnapshotSpec) { + *out = *in + in.Accessibility.DeepCopyInto(&out.Accessibility) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotSpec. +func (in *LocalVolumeSnapshotSpec) DeepCopy() *LocalVolumeSnapshotSpec { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalVolumeSnapshotStatus) DeepCopyInto(out *LocalVolumeSnapshotStatus) { + *out = *in + if in.ReplicaSnapshots != nil { + in, out := &in.ReplicaSnapshots, &out.ReplicaSnapshots + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CreationTime != nil { + in, out := &in.CreationTime, &out.CreationTime + *out = (*in).DeepCopy() + } + out.Attribute = in.Attribute + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalVolumeSnapshotStatus. +func (in *LocalVolumeSnapshotStatus) DeepCopy() *LocalVolumeSnapshotStatus { + if in == nil { + return nil + } + out := new(LocalVolumeSnapshotStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LocalVolumeSpec) DeepCopyInto(out *LocalVolumeSpec) { *out = *in + out.VolumeQoS = in.VolumeQoS in.Accessibility.DeepCopyInto(&out.Accessibility) if in.Config != nil { in, out := &in.Config, &out.Config @@ -1437,6 +1971,114 @@ func (in *RAIDInfo) DeepCopy() *RAIDInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResizePolicy) DeepCopyInto(out *ResizePolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResizePolicy. +func (in *ResizePolicy) DeepCopy() *ResizePolicy { + if in == nil { + return nil + } + out := new(ResizePolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResizePolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResizePolicyList) DeepCopyInto(out *ResizePolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ResizePolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResizePolicyList. +func (in *ResizePolicyList) DeepCopy() *ResizePolicyList { + if in == nil { + return nil + } + out := new(ResizePolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ResizePolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResizePolicySpec) DeepCopyInto(out *ResizePolicySpec) { + *out = *in + if in.StorageClassSelector != nil { + in, out := &in.StorageClassSelector, &out.StorageClassSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.PVCSelector != nil { + in, out := &in.PVCSelector, &out.PVCSelector + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResizePolicySpec. +func (in *ResizePolicySpec) DeepCopy() *ResizePolicySpec { + if in == nil { + return nil + } + out := new(ResizePolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResizePolicyStatus) DeepCopyInto(out *ResizePolicyStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResizePolicyStatus. +func (in *ResizePolicyStatus) DeepCopy() *ResizePolicyStatus { + if in == nil { + return nil + } + out := new(ResizePolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SmartInfo) DeepCopyInto(out *SmartInfo) { *out = *in @@ -1561,6 +2203,22 @@ func (in *VolumeInfo) DeepCopy() *VolumeInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeQoS) DeepCopyInto(out *VolumeQoS) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeQoS. +func (in *VolumeQoS) DeepCopy() *VolumeQoS { + if in == nil { + return nil + } + out := new(VolumeQoS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeReplica) DeepCopyInto(out *VolumeReplica) { *out = *in @@ -1576,3 +2234,19 @@ func (in *VolumeReplica) DeepCopy() *VolumeReplica { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeSnapshotAttr) DeepCopyInto(out *VolumeSnapshotAttr) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSnapshotAttr. +func (in *VolumeSnapshotAttr) DeepCopy() *VolumeSnapshotAttr { + if in == nil { + return nil + } + out := new(VolumeSnapshotAttr) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index d2165bca..029d970d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -85,7 +85,7 @@ github.com/googleapis/gnostic/openapiv2 ## explicit; go 1.12 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru -# github.com/hwameistor/hwameistor v0.10.3 +# github.com/hwameistor/hwameistor v0.12.1 ## explicit; go 1.18 github.com/hwameistor/hwameistor/deploy/crds github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned