ssp-operator
ssp-operator copied to clipboard
feat: allow external DataImportCron to manage DataSources
What this PR does / why we need it: The DataSources created by SSP can now be managed by a DataImportCron that was not created by SSP.
Which issue(s) this PR fixes: Fixes: https://issues.redhat.com/browse/CNV-49658
Release note:
DataSources created by SSP can now be managed by external DataImportCrons.
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
Quality Gate passed
Issues
5 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@sourcery-ai review
Reviewer's Guide by Sourcery
This pull request introduces changes to allow DataSources created by SSP to be managed by external DataImportCrons. The changes include modifications to the reconcile logic to prevent reconciliation of DataSources managed by external DataImportCrons, added tests to verify the new functionality, and error handling to prevent conflicts between DataImportCron templates and external DataImportCrons.
Sequence diagram for dataSourceAutoUpdateEnabled with external DataImportCron
sequenceDiagram
participant DS as DataSource
participant K8sClient as Kubernetes Client
participant DIC as DataImportCron
DS->>K8sClient: Get DataSource
K8sClient-->>DS: Returns DataSource with dataImportCronLabel
DS->>DS: Check if DataImportCron template exists
alt DataImportCron template does not exist
DS->>DS: externalCronExists = true
DS->>DS: Return reconcileDataSource = false, reconcileDataImportCron = false
else DataImportCron template exists
DS->>DS: externalCronExists = false
end
Sequence diagram for dataSourceAutoUpdateEnabled with DataImportCron template
sequenceDiagram
participant DS as DataSource
participant K8sClient as Kubernetes Client
participant DIC as DataImportCron
DS->>K8sClient: Get DataSource
K8sClient-->>DS: Returns DataSource
DS->>DS: Check if DataImportCron template exists
alt DataImportCron template exists
DS->>DS: Check if external DataImportCron exists
alt external DataImportCron exists
DS->>DS: Return error
else external DataImportCron does not exist
DS->>DS: Check if DataSource uses golden image PVC
alt DataSource uses golden image PVC
DS->>DS: Return reconcileDataSource = true, reconcileDataImportCron = false
else DataSource does not use golden image PVC
DS->>DS: Return reconcileDataSource = false, reconcileDataImportCron = true
end
end
else DataImportCron template does not exist
DS->>DS: Return reconcileDataSource = true, reconcileDataImportCron = false
end
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Added tests to verify that DataSources are not reconciled when managed by an external DataImportCron. |
|
tests/dataSources_test.go |
| Modified the reconcile logic to prevent reconciliation of DataSources managed by external DataImportCrons and to handle conflicts between DataImportCron templates and external DataImportCrons. |
|
internal/operands/data-sources/reconcile.go |
| Added unit tests for the data-sources operand to verify the changes related to external DataImportCrons. |
|
internal/operands/data-sources/reconcile_test.go |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review! - Generate a plan of action for an issue: Comment
@sourcery-ai planon an issue to generate a plan of action for it.
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign 0xfelix for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/cc @0xFelix @jcanocan @codingben
Quality Gate passed
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@akrejcir: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| ci/prow/e2e-upgrade-functests | 9390d1138ffacb59adb76181ec58b206054d0450 | link | true | /test e2e-upgrade-functests |
| ci/prow/e2e-functests | 9390d1138ffacb59adb76181ec58b206054d0450 | link | true | /test e2e-functests |
| ci/prow/e2e-single-node-functests | 9390d1138ffacb59adb76181ec58b206054d0450 | link | true | /test e2e-single-node-functests |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
When external DataImporCron is created, it does not trigger SSP reconciliation, so the operator has no chance to react to it, and give management of DataSource to CDI. I need to rethink this.
/hold
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
The functionality implemented in this PR would be more difficult with the upcoming heterogeneous cluster functionality.
Closing this for now, we can reopen if we resume development.
/close
@akrejcir: Closed this PR.
In response to this:
The functionality implemented in this PR would be more difficult with the upcoming heterogeneous cluster functionality.
Closing this for now, we can reopen if we resume development.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.