mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
feat(backup,restore): adding validation for backup and restore
Added a schema validation for backup and restore CR. Also validating the server address in the backup/restore controller. Validating the server address as : ^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$ which is : <any number>.<any number>.<any number>.<any number>:<any number> Here we are validating just the format of the IP, not validating that IP should be correct which will be little more complex. In any case if IP is not correct, the zfs send will fail, so no need to do complex validation to validate the correct IP and port. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
5ea411ad05
commit
26968b5394
7 changed files with 62 additions and 15 deletions
|
|
@ -895,6 +895,7 @@ spec:
|
|||
backupDest:
|
||||
description: BackupDest is the remote address for backup transfer
|
||||
minLength: 1
|
||||
pattern: ^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$
|
||||
type: string
|
||||
ownerNodeID:
|
||||
description: OwnerNodeID is a name of the nodes where the source volume
|
||||
|
|
@ -920,6 +921,13 @@ spec:
|
|||
type: object
|
||||
status:
|
||||
description: ZFSBackupStatus is to hold status of backup
|
||||
enum:
|
||||
- Init
|
||||
- Done
|
||||
- Failed
|
||||
- Pending
|
||||
- InProgress
|
||||
- Invalid
|
||||
type: string
|
||||
required:
|
||||
- spec
|
||||
|
|
@ -993,6 +1001,7 @@ spec:
|
|||
description: it can be ip:port in case of restore from remote or volumeName
|
||||
in case of local restore
|
||||
minLength: 1
|
||||
pattern: ^([0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+)$
|
||||
type: string
|
||||
volumeName:
|
||||
description: volume name to where restore has to be performed
|
||||
|
|
@ -1005,6 +1014,13 @@ spec:
|
|||
type: object
|
||||
status:
|
||||
description: ZFSRestoreStatus is to hold result of action.
|
||||
enum:
|
||||
- Init
|
||||
- Done
|
||||
- Failed
|
||||
- Pending
|
||||
- InProgress
|
||||
- Invalid
|
||||
type: string
|
||||
required:
|
||||
- spec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue