Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backup,restore): adding validation for backup and restore #221

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

pawanpraka1
Copy link
Contributor

@pawanpraka1 pawanpraka1 commented Sep 21, 2020

Signed-off-by: Pawan pawan@mayadata.io

Why is this PR required? What issue does it fix?:

Added a schema validation for backup and restore CR. Also validating
the server address in the backup/restore controller.

What this PR does?:

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.

Does this PR require any upgrade changes?:

NA

Checklist:

  • Fixes #
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Has the change log section been updated?
  • Commit has unit tests
  • Commit has integration tests
  • (Optional) Are upgrade changes included in this PR? If not, mention the issue/PR to track:
  • (Optional) If documentation changes are required, which issue on https://github.com/openebs/openebs-docs is used to track them:

@pawanpraka1 pawanpraka1 added the enhancement Add new functionality to existing feature label Sep 21, 2020
@pawanpraka1 pawanpraka1 added this to the v1.0.1 milestone Sep 21, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2020

Codecov Report

Merging #221 into master will decrease coverage by 1.31%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #221      +/-   ##
=========================================
- Coverage    9.82%   8.50%   -1.32%     
=========================================
  Files          20      20              
  Lines        1171    1046     -125     
=========================================
- Hits          115      89      -26     
+ Misses       1055     956      -99     
  Partials        1       1              
Impacted Files Coverage Δ
pkg/client/k8s/v1alpha1/dynamic.go 80.00% <0.00%> (-5.72%) ⬇️
pkg/client/k8s/v1alpha1/clientset.go 80.00% <0.00%> (-5.72%) ⬇️
pkg/client/k8s/v1alpha1/configmap.go 85.71% <0.00%> (-3.18%) ⬇️
pkg/client/k8s/v1alpha1/config.go 83.33% <0.00%> (-1.29%) ⬇️
pkg/driver/controller.go 0.90% <0.00%> (-0.26%) ⬇️
pkg/usage/size.go 100.00% <0.00%> (ø)
pkg/driver/grpc.go 0.00% <0.00%> (ø)
pkg/usage/usage.go 0.00% <0.00%> (ø)
pkg/driver/agent.go 0.00% <0.00%> (ø)
pkg/driver/driver.go 0.00% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9ea713...39a5ff8. Read the comment docs.

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>
@kmova kmova merged commit 26968b5 into openebs:master Sep 30, 2020
@pawanpraka1 pawanpraka1 deleted the backup branch October 8, 2020 08:56
pawanpraka1 added a commit to pawanpraka1/zfs-localpv that referenced this pull request Oct 12, 2020
Following PR added for changelog
- openebs#211
- openebs#221

Signed-off-by: Pawan <pawan@mayadata.io>
pawanpraka1 added a commit to pawanpraka1/zfs-localpv that referenced this pull request Oct 12, 2020
Following PR added for changelog
- openebs#211
- openebs#221

Signed-off-by: Pawan <pawan@mayadata.io>
kmova pushed a commit that referenced this pull request Oct 15, 2020
Following PR added for changelog
- #211
- #221

Signed-off-by: Pawan <pawan@mayadata.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Add new functionality to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants