@alauda-fe/storage 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/pvc-form/component.mjs +164 -136
- package/esm2022/lib/components/storage-feature-tags/component.mjs +19 -21
- package/esm2022/lib/components/storageclass-select/component.mjs +31 -16
- package/esm2022/lib/services/common-util.service.mjs +13 -25
- package/esm2022/lib/services/pvc-util.service.mjs +4 -4
- package/esm2022/lib/types/commons.mjs +2 -1
- package/esm2022/lib/types/k8s.mjs +1 -1
- package/esm2022/lib/utils/constants.mjs +2 -1
- package/esm2022/lib/utils/util.mjs +9 -10
- package/lib/components/pvc-form/component.d.ts +6 -0
- package/lib/components/storage-feature-tags/component.d.ts +1 -1
- package/lib/services/common-util.service.d.ts +6 -4
- package/lib/types/commons.d.ts +2 -1
- package/lib/types/k8s.d.ts +56 -0
- package/lib/utils/constants.d.ts +1 -0
- package/lib/utils/util.d.ts +3 -3
- package/package.json +1 -1
|
@@ -34,12 +34,16 @@ export declare class PersistentVolumeClaimFormComponent extends PersistentVolume
|
|
|
34
34
|
volumeMode: VolumeMode;
|
|
35
35
|
displayFields: DisplayField[];
|
|
36
36
|
get showAdvancedField(): boolean;
|
|
37
|
+
get isFromSnapshotAndSourcePVCExist(): boolean;
|
|
38
|
+
get selectDefault(): boolean;
|
|
39
|
+
get showStorageClassHintWhenFromSnapshot(): boolean;
|
|
37
40
|
accessModes: ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany")[];
|
|
38
41
|
volumeModes: ("Filesystem" | "Block")[];
|
|
39
42
|
POSITIVE_INT_PATTERN: {
|
|
40
43
|
pattern: RegExp;
|
|
41
44
|
tip: string;
|
|
42
45
|
};
|
|
46
|
+
originResource: PersistentVolumeClaim;
|
|
43
47
|
model: PersistentVolumeFormModel;
|
|
44
48
|
resourceNameReg: {
|
|
45
49
|
pattern: RegExp;
|
|
@@ -53,6 +57,7 @@ export declare class PersistentVolumeClaimFormComponent extends PersistentVolume
|
|
|
53
57
|
ReadWriteOnce: string;
|
|
54
58
|
ReadOnlyMany: string;
|
|
55
59
|
ReadWriteMany: string;
|
|
60
|
+
ReadWriteOncePod: string;
|
|
56
61
|
};
|
|
57
62
|
VolumeModeTranslateKey: {
|
|
58
63
|
Filesystem: string;
|
|
@@ -95,6 +100,7 @@ export declare class PersistentVolumeClaimFormComponent extends PersistentVolume
|
|
|
95
100
|
constructor(storageCommonUtil: StorageCommonUtilService, translate: TranslateService, k8sApi: K8sApiService);
|
|
96
101
|
createMethodChange(createType: PvcStorageClassCreateType): void;
|
|
97
102
|
storageclassChange(selectedOption: StorageSelectOption): void;
|
|
103
|
+
volumeModeChange(volumeMode: VolumeMode): void;
|
|
98
104
|
displayFieldSupported(fieldName: DisplayField): boolean;
|
|
99
105
|
private setAccessModeToSupportValueIfNeed;
|
|
100
106
|
private setVolumeModeToSupportValueIfNeed;
|
|
@@ -19,7 +19,7 @@ export declare class StorageFeatureTagsComponent {
|
|
|
19
19
|
private updateStorageClassFeature;
|
|
20
20
|
private updateVolumeSnapshotFeature;
|
|
21
21
|
private hasVolumeSnapshotFeature;
|
|
22
|
-
private
|
|
22
|
+
private updateThirdPartyFeature;
|
|
23
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<StorageFeatureTagsComponent, never>;
|
|
24
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<StorageFeatureTagsComponent, "acl-storage-feature-tags", never, { "provisioner": { "alias": "provisioner"; "required": true; }; "storageClass": { "alias": "storageClass"; "required": false; }; "hasDefault": { "alias": "hasDefault"; "required": false; }; "volumeSnapshotClasses": { "alias": "volumeSnapshotClasses"; "required": false; }; }, {}, never, never, true, never>;
|
|
25
25
|
}
|
|
@@ -7,10 +7,12 @@ export interface StorageSelectOption {
|
|
|
7
7
|
value: string;
|
|
8
8
|
isDefault: boolean;
|
|
9
9
|
accessModes: AccessMode[];
|
|
10
|
+
blockAccessModes?: AccessMode[];
|
|
10
11
|
features: StorageclassFeature[];
|
|
11
12
|
volumeModes: VolumeMode[];
|
|
12
13
|
provisioner: StorageProvisioner;
|
|
13
14
|
storageClass: StorageClass;
|
|
15
|
+
displayName?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare class StorageCommonUtilService {
|
|
16
18
|
private readonly k8sUtil;
|
|
@@ -24,14 +26,14 @@ export declare class StorageCommonUtilService {
|
|
|
24
26
|
/**
|
|
25
27
|
* 获取第三方快照能力支持情况,若返回 null 表示未匹配到三方存储
|
|
26
28
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
getStorageclassAccessModes(sc: CommonStorageClass, storageDescriptionMaps: StringMap[], isFromSnapshot: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany")[];
|
|
29
|
+
getThirdPartyFeatureSupported(sc: CommonStorageClass, storageDescriptionMaps: StringMap[], feature: StorageclassFeature): boolean | null;
|
|
30
|
+
getStorageclassAccessModes(sc: CommonStorageClass, storageDescriptionMaps: StringMap[], isFromSnapshot: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany" | "ReadWriteOncePod")[];
|
|
30
31
|
getStorageclassVolumeModes(sc: CommonStorageClass, storageDescriptionMaps: StringMap[]): ("Filesystem" | "Block")[];
|
|
31
|
-
isAccessModeDisabled(accessMode: AccessMode, storageClassOption: StorageSelectOption): boolean;
|
|
32
|
+
isAccessModeDisabled(accessMode: AccessMode, storageClassOption: StorageSelectOption, isBlock?: boolean): boolean;
|
|
32
33
|
isVolumeModeDisabled(volumeMode: VolumeMode, storageClassOption: StorageSelectOption): boolean;
|
|
33
34
|
private findStorageDescriptionMap;
|
|
34
35
|
private getThirdPartyStorageclassAccessModes;
|
|
36
|
+
private getThirdPartyStorageclassBlockAccessModes;
|
|
35
37
|
private getThirdPartyStorageclassVolumeModes;
|
|
36
38
|
/**
|
|
37
39
|
* 解析 ConfigMap 中的 AccessModes 和 VolumeModes, 要求 cm 中的配置不区分大小,满足 AccessModes 或 VolumeModes 中定义即可
|
package/lib/types/commons.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ export declare const StorageType: {
|
|
|
21
21
|
export type StorageType = ValueOf<typeof StorageType>;
|
|
22
22
|
export declare enum StorageclassFeature {
|
|
23
23
|
SNAPSHOT = "snapshot",
|
|
24
|
-
EXPANSION = "expansion"
|
|
24
|
+
EXPANSION = "expansion",
|
|
25
|
+
CLONE = "clone"
|
|
25
26
|
}
|
|
26
27
|
export interface StorageOption {
|
|
27
28
|
provisioner: StorageProvisioner;
|
package/lib/types/k8s.d.ts
CHANGED
|
@@ -345,6 +345,61 @@ export declare enum TopolvmClusterStorageDeviceClassStatusEnum {
|
|
|
345
345
|
AVAILABLE = "available",
|
|
346
346
|
NOT_AVAILABLE = "not_available"
|
|
347
347
|
}
|
|
348
|
+
export interface ThinPoolConfig {
|
|
349
|
+
/**
|
|
350
|
+
* Name specifies a name for the thin pool.
|
|
351
|
+
*/
|
|
352
|
+
name?: string;
|
|
353
|
+
/**
|
|
354
|
+
* OverProvisionRatio specifies a factor by which you can provision additional storage
|
|
355
|
+
* based on the available storage in the thin pool.
|
|
356
|
+
* To prevent over-provisioning through validation, set this field to 1.
|
|
357
|
+
* Minimum: 1
|
|
358
|
+
*/
|
|
359
|
+
overprovisionRatio: number;
|
|
360
|
+
/**
|
|
361
|
+
* ChunkSize specifies the statically calculated chunk size for the thin pool.
|
|
362
|
+
* Used only when ChunkSizeCalculationPolicy = "Static".
|
|
363
|
+
* Default: 128Ki if not set.
|
|
364
|
+
* Range: 64Ki – 1Gi.
|
|
365
|
+
*
|
|
366
|
+
* Can be integer or string (e.g., "128Mi").
|
|
367
|
+
* // cspell: disable-next-line
|
|
368
|
+
* Pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
|
369
|
+
*/
|
|
370
|
+
chunkSize?: number | string;
|
|
371
|
+
/**
|
|
372
|
+
* ChunkSizeCalculationPolicy specifies how chunk size is determined.
|
|
373
|
+
* - "Host": use the host lvm2 setting.
|
|
374
|
+
* - "Static": use the ChunkSize value.
|
|
375
|
+
* Default: "Static".
|
|
376
|
+
*/
|
|
377
|
+
chunkSizeCalculationPolicy?: 'Host' | 'Static';
|
|
378
|
+
/**
|
|
379
|
+
* MetadataSize specifies metadata size for the thin pool.
|
|
380
|
+
* Used only when MetadataSizeCalculationPolicy = "Static".
|
|
381
|
+
* Default: 1Gi if not set.
|
|
382
|
+
* Range: 2Mi – 16Gi.
|
|
383
|
+
*
|
|
384
|
+
* Can be integer or string (e.g., "1Gi").
|
|
385
|
+
* Pattern same as chunkSize.
|
|
386
|
+
*/
|
|
387
|
+
metadataSize?: number | string;
|
|
388
|
+
/**
|
|
389
|
+
* MetadataSizeCalculationPolicy specifies how metadata size is determined.
|
|
390
|
+
* - "Host": use lvm2 default settings.
|
|
391
|
+
* - "Static": use the MetadataSize value.
|
|
392
|
+
* Default: "Host".
|
|
393
|
+
*/
|
|
394
|
+
metadataSizeCalculationPolicy?: 'Host' | 'Static';
|
|
395
|
+
/**
|
|
396
|
+
* SizePercent specifies the percentage of space in the LVM volume group
|
|
397
|
+
* for creating the thin pool.
|
|
398
|
+
* Default: 90.
|
|
399
|
+
* Range: 10 – 100.
|
|
400
|
+
*/
|
|
401
|
+
sizePercent?: number;
|
|
402
|
+
}
|
|
348
403
|
export interface TopolvmClusterSpecDeviceClassItem {
|
|
349
404
|
className: string;
|
|
350
405
|
default: boolean;
|
|
@@ -353,6 +408,7 @@ export interface TopolvmClusterSpecDeviceClassItem {
|
|
|
353
408
|
name: string;
|
|
354
409
|
type: TopolvmDeviceType;
|
|
355
410
|
}>;
|
|
411
|
+
thinPoolConfig?: ThinPoolConfig;
|
|
356
412
|
}
|
|
357
413
|
export interface TopolvmClusterSpecDeviceClass {
|
|
358
414
|
nodeName: string;
|
package/lib/utils/constants.d.ts
CHANGED
package/lib/utils/util.d.ts
CHANGED
|
@@ -4,16 +4,16 @@ import { CommonStorageClass, PersistentVolume, StorageClass, VolumeSnapshot, Vol
|
|
|
4
4
|
import { VolumeSnapshotStatus } from './constants';
|
|
5
5
|
export declare function getProvisioner(sc: CommonStorageClass | StorageOption): StorageProvisioner;
|
|
6
6
|
export declare function getProvisionerDisplay(sc: CommonStorageClass | StorageOption): Translation;
|
|
7
|
-
export declare function getProvisionerType(provisioner: StorageProvisioner): "file_storage" | "object_storage" | "block_storage" | "unknown";
|
|
8
7
|
export declare function getStorageclassVolumeModes(provisioner: StorageProvisioner): ("Filesystem" | "Block")[];
|
|
9
|
-
export declare function getStorageclassAccessModes(provisioner: StorageProvisioner, isFromSnapshot?: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany")[];
|
|
8
|
+
export declare function getStorageclassAccessModes(provisioner: StorageProvisioner, isFromSnapshot?: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany" | "ReadWriteOncePod")[];
|
|
10
9
|
export declare function isDefaultStorageclass(data: CommonStorageClass): boolean;
|
|
11
10
|
export declare function isStorageClassSupportSnapshot(sc: StorageClass, vscList: VolumeSnapshotClass[]): boolean;
|
|
12
11
|
export declare function buildPvcResource({ namespace, snapshot, volumeMode, }: {
|
|
13
12
|
namespace: string;
|
|
14
13
|
snapshot?: string;
|
|
15
14
|
volumeMode?: VolumeMode;
|
|
16
|
-
},
|
|
15
|
+
}, pvcResource?: PersistentVolumeClaim, // 创建快照类 Pvc 时传入
|
|
16
|
+
snapshotResource?: VolumeSnapshot): PersistentVolumeClaim;
|
|
17
17
|
export declare function getVolumeSnapshotStatus(resource: VolumeSnapshot): VolumeSnapshotStatus;
|
|
18
18
|
export declare function getPvcStatus(status: PersistentVolumeClaimStatus, refStorageclass?: StorageClass): PvcStatusEnum;
|
|
19
19
|
export declare function getPvStatus(pv: PersistentVolume): PvStatusEnum;
|