-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(validation): adding validation for ZFSPV CR parameters #66
Conversation
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
=======================================
Coverage 23.57% 23.57%
=======================================
Files 14 14
Lines 475 475
=======================================
Hits 112 112
Misses 362 362
Partials 1 1 Continue to review full report at Codecov.
|
072f247
to
7afd210
Compare
@pawanpraka1 -- any validations required for the ZFS Snapshot CRD? |
no @kmova, user will modify ZFSVolume CR only for the property change. |
Makes sense. on second thought, does adding validations for non-editable fields help in making sure the code also doesn't misbehave, can work as an added validation as the contributions to the project increase? |
Sure, I will add the validation for snapshot also. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes looks good.
3b95381
to
d7a135c
Compare
bd79287
to
7404088
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm , thanks
Validating few parameters for the ZFSVolume custom resource - compression can be "on", "off", "lzjb", "gzip", "gzip-[1-9]", "zle" and "lz4" - encryption can be "on", "off", "aes-128-ccm", "aes-192-ccm", "aes-256-ccm", "aes-128-gcm", "aes-192-gcm", and "aes-256-gcm" - dedup can be "on" and "off" - poolname can be string - ownernodeid can be string - thinprovision can be "yes" and "no" - volumetype can be "DATASET" and "ZVOL" Also added required fields needed to create ZFSVolume CR - ownerNodeID - poolname - volumeType - capacity Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
be1a639
to
994c7a3
Compare
Signed-off-by: Pawan <pawan@mayadata.io>
ddbb9b6
to
1e98277
Compare
Signed-off-by: Pawan <pawan@mayadata.io>
Validating few parameters for the ZFSVolume custom resource - compression can be "on", "off", "lzjb", "gzip", "gzip-[1-9]", "zle" and "lz4" - encryption can be "on", "off", "aes-128-ccm", "aes-192-ccm", "aes-256-ccm", "aes-128-gcm", "aes-192-gcm", and "aes-256-gcm" - dedup can be "on" and "off" - poolname can be string - ownernodeid can be string - thinprovision can be "yes" and "no" - volumetype can be "DATASET" and "ZVOL" Also added required fields needed to create ZFSVolume CR - ownerNodeID - poolname - volumeType - capacity Signed-off-by: Pawan <pawan@mayadata.io>
Validating few parameters for the ZFSVolume custom resource - compression can be "on", "off", "lzjb", "gzip", "gzip-[1-9]", "zle" and "lz4" - encryption can be "on", "off", "aes-128-ccm", "aes-192-ccm", "aes-256-ccm", "aes-128-gcm", "aes-192-gcm", and "aes-256-gcm" - dedup can be "on" and "off" - poolname can be string - ownernodeid can be string - thinprovision can be "yes" and "no" - volumetype can be "DATASET" and "ZVOL" Also added required fields needed to create ZFSVolume CR - ownerNodeID - poolname - volumeType - capacity Signed-off-by: Pawan <pawan@mayadata.io>
Validating few parameters for the ZFSVolume custom resource
Also added required fields needed to create ZFSVolume CR
For the below wrong yaml
Applying it will throw this error
$ kubectl apply -f zfspvcr.yaml
The ZFSVolume "pvc-test" is invalid: spec.compression: Invalid value: "": spec.compression in body should match '^(on|off|lzjb|gzip|gzip-[1-9]|zle|lz4)$'
Signed-off-by: Pawan pawan@mayadata.io