backube / volsync

Asynchronous data replication for Kubernetes volumes
https://volsync.readthedocs.io
GNU Affero General Public License v3.0
601 stars 68 forks source link

Allow disabling mover code with build tags #1366

Closed tesshuflower closed 2 months ago

tesshuflower commented 3 months ago

Describe what this PR does

Is there anything that requires special attention?

Related issues:

tesshuflower commented 3 months ago

/cc @JohnStrunk

tesshuflower commented 2 months ago

/retest

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

tesshuflower commented 2 months ago

@JohnStrunk I've updated the Makefile, I think it works pretty well with the changes you suggested.

I also made a change to update the err we put in the status conditions if the mover isn't found to list what movers are enabled - so you get something like this:

status:
  conditions:
  - lastTransitionTime: "2024-08-29T17:52:07Z"
    message: 'a replication method must be specified - enabled movers: [rclone rsync
      rsync-tls]'
    reason: Error
    status: "False"
    type: Synchronizing

This change is just with the last commit in the PR, so we can roll it back if you think it's overkill.

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnStrunk, 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: - ~~[OWNERS](https://github.com/backube/volsync/blob/main/OWNERS)~~ [JohnStrunk,tesshuflower] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
tesshuflower commented 2 months ago

/retest

tesshuflower commented 2 months ago

/retest

tesshuflower commented 2 months ago

/retest

tesshuflower commented 2 months ago

/retest

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.

Project coverage is 67.3%. Comparing base (0448389) to head (3292d8e). Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
controllers/mover/rclone/builder.go 50.0% 1 Missing :warning:
controllers/mover/rclone/mover.go 0.0% 1 Missing :warning:
controllers/mover/restic/builder.go 0.0% 1 Missing :warning:
controllers/mover/restic/mover.go 0.0% 1 Missing :warning:
controllers/mover/rsync/builder.go 0.0% 1 Missing :warning:
controllers/mover/rsync/mover.go 0.0% 1 Missing :warning:
controllers/mover/rsynctls/builder.go 0.0% 1 Missing :warning:
controllers/mover/rsynctls/mover.go 0.0% 1 Missing :warning:
controllers/mover/syncthing/builder.go 0.0% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1366 +/- ## ======================================= - Coverage 67.4% 67.3% -0.1% ======================================= Files 57 57 Lines 5824 5829 +5 ======================================= Hits 3926 3926 - Misses 1610 1615 +5 Partials 288 288 ``` | [Files with missing lines](https://app.codecov.io/gh/backube/volsync/pull/1366?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube) | Coverage Δ | | |---|---|---| | [controllers/mover/rclone/logfilter.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frclone%2Flogfilter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcmNsb25lL2xvZ2ZpbHRlci5nbw==) | `100.0% <ø> (ø)` | | | [controllers/mover/restic/logfilter.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frestic%2Flogfilter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcmVzdGljL2xvZ2ZpbHRlci5nbw==) | `100.0% <ø> (ø)` | | | [controllers/mover/rsync/logfilter.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frsync%2Flogfilter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcnN5bmMvbG9nZmlsdGVyLmdv) | `100.0% <ø> (ø)` | | | [controllers/mover/rsync/rsync\_common.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frsync%2Frsync_common.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcnN5bmMvcnN5bmNfY29tbW9uLmdv) | `65.7% <ø> (ø)` | | | [controllers/mover/rsynctls/logfilter.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frsynctls%2Flogfilter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcnN5bmN0bHMvbG9nZmlsdGVyLmdv) | `100.0% <ø> (ø)` | | | [controllers/mover/rsynctls/rsync\_common.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Frsynctls%2Frsync_common.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvcnN5bmN0bHMvcnN5bmNfY29tbW9uLmdv) | `70.0% <ø> (ø)` | | | [controllers/mover/syncthing/api/connection.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Fsyncthing%2Fapi%2Fconnection.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvc3luY3RoaW5nL2FwaS9jb25uZWN0aW9uLmdv) | `89.4% <ø> (ø)` | | | [...ontrollers/mover/syncthing/api/connection\_utils.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Fsyncthing%2Fapi%2Fconnection_utils.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvc3luY3RoaW5nL2FwaS9jb25uZWN0aW9uX3V0aWxzLmdv) | `65.6% <ø> (ø)` | | | [controllers/mover/syncthing/api/utils.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Fsyncthing%2Fapi%2Futils.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvc3luY3RoaW5nL2FwaS91dGlscy5nbw==) | `83.0% <ø> (ø)` | | | [controllers/mover/syncthing/mover.go](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree&filepath=controllers%2Fmover%2Fsyncthing%2Fmover.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube#diff-Y29udHJvbGxlcnMvbW92ZXIvc3luY3RoaW5nL21vdmVyLmdv) | `83.5% <100.0%> (ø)` | | | ... and [13 more](https://app.codecov.io/gh/backube/volsync/pull/1366?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=backube) | |