volsync icon indicating copy to clipboard operation
volsync copied to clipboard

WIP - rsync src mover - mount PVC as readOnly for ROX

Open tesshuflower opened this issue 3 years ago • 4 comments

Signed-off-by: Tesshu Flower [email protected]

Describe what this PR does In cases where the source PVC accessModes only supports ReadOnlyMany (ROX), mount the pvc as read-only in the ReplicationSource mover job.

  • Not doing this for other PVCs as I have encountered permission errors when trying to access the volume mounted as read-only. So far testing with CephFS and ROX pvcs it does not have issues when mounting read-only.

Is there anything that requires special attention?

  • Attempts to avoid changing for most current scenarios by mounting read-only only for replicationSource (where we do not need to write to the PVC) and only when the source PVC access modes only allow ROX.

  • This change right now is confined to rsync - we could potentially attempt to do a similar change for other movers as well?

Related issues: https://github.com/backube/volsync/issues/404

tesshuflower avatar Aug 30 '22 19:08 tesshuflower

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tesshuflower

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Aug 30 '22 19:08 openshift-ci[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 01 '22 18:09 sonarqubecloud[bot]

/retest

tesshuflower avatar Sep 02 '22 12:09 tesshuflower

Codecov Report

Merging #406 (020fe4b) into main (bbe8d9d) will increase coverage by 0.1%. The diff coverage is 100.0%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #406     +/-   ##
=======================================
+ Coverage   64.1%   64.2%   +0.1%     
=======================================
  Files         44      44             
  Lines       5104    5120     +16     
=======================================
+ Hits        3273    3289     +16     
  Misses      1634    1634             
  Partials     197     197             
Impacted Files Coverage Δ
controllers/mover/rsync/mover.go 76.6% <100.0%> (+0.3%) :arrow_up:
controllers/utils/utils.go 17.4% <100.0%> (+17.4%) :arrow_up:

codecov[bot] avatar Sep 02 '22 14:09 codecov[bot]

/cc @JohnStrunk

I think this one is pretty well tested now from the ramen side - What do you think?

tesshuflower avatar Sep 06 '22 18:09 tesshuflower

/lgtm We should probably open issue(s) to apply this to restic and rclone also.

JohnStrunk avatar Sep 06 '22 19:09 JohnStrunk

Created issues for restic and rclone: https://github.com/backube/volsync/issues/412 https://github.com/backube/volsync/issues/411

tesshuflower avatar Sep 06 '22 19:09 tesshuflower