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

Use the MedusaConfiguration API when creating Medusa configuration #1187

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

rzvoncek
Copy link
Contributor

@rzvoncek rzvoncek commented Jan 25, 2024

What this PR does:

  • Adds an ObjectReference to the Medusa spec to allow referencing MedusaConfig.
  • Modifies the k8ssandra cluster creation webohook to error out if the reference is present but the medusa storage prefix is not set in the cluster's spec.
  • When creating the cluster, or rather it's medusa.ini config map, merge both the MedusaConfig and the cluster spec, giving priority to the later.

Which issue(s) this PR fixes:
Fixes #1158.

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (651e3f7) 57.13% compared to head (f25a17c) 57.15%.

❗ Current head f25a17c differs from pull request most recent head f3a2bed. Consider uploading reports for the commit f3a2bed to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1187      +/-   ##
==========================================
+ Coverage   57.13%   57.15%   +0.01%     
==========================================
  Files         103      103              
  Lines       10618    10647      +29     
==========================================
+ Hits         6067     6085      +18     
- Misses       4023     4029       +6     
- Partials      528      533       +5     
Files Coverage Δ
...pis/k8ssandra/v1alpha1/k8ssandracluster_webhook.go 71.27% <100.00%> (+1.61%) ⬆️
controllers/k8ssandra/medusa_reconciler.go 63.92% <44.00%> (-3.99%) ⬇️

... and 3 files with indirect coverage changes

@rzvoncek rzvoncek force-pushed the radovan/medusaConfigurationRef branch from 1edc1c5 to 1b9f17d Compare January 26, 2024 12:12
@rzvoncek rzvoncek changed the title eMake Medusa's config map be a merge of MedusaConfig object and clusterr spec Make Medusa's config map be a merge of MedusaConfig object and clusterr spec Jan 26, 2024
@rzvoncek rzvoncek changed the title Make Medusa's config map be a merge of MedusaConfig object and clusterr spec Start using MedusaConfig Jan 26, 2024
@rzvoncek rzvoncek marked this pull request as ready for review January 26, 2024 12:47
@rzvoncek rzvoncek requested a review from a team as a code owner January 26, 2024 12:47
@rzvoncek rzvoncek changed the title Start using MedusaConfig Use the MedusaConfiguration API when creating Medusa configuration Jan 26, 2024
@rzvoncek rzvoncek force-pushed the radovan/medusaConfigurationRef branch 2 times, most recently from 37769ff to 613facc Compare January 26, 2024 13:25
Copy link
Contributor

@adejanovski adejanovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor changes and a todo:

We need an e2e test for this.
Modify the single-dc-encryption-medusa fixture to add a MedusaConfiguration object and modify the K8ssandraCluster storage properties to replace them with the medusaConfigurationRef.
The medusa-bucket-key will be created already (it's at the root of the fixtures directory) so you just need to reference it in the MedusaConfiguration object.

apis/k8ssandra/v1alpha1/k8ssandracluster_webhook.go Outdated Show resolved Hide resolved
controllers/k8ssandra/medusa_reconciler.go Outdated Show resolved Hide resolved
controllers/k8ssandra/medusa_reconciler_test.go Outdated Show resolved Hide resolved
docs/content/en/tasks/backup-restore/_index.md Outdated Show resolved Hide resolved
@rzvoncek rzvoncek force-pushed the radovan/medusaConfigurationRef branch 2 times, most recently from ab447e3 to f25a17c Compare January 29, 2024 14:09
@rzvoncek rzvoncek force-pushed the radovan/medusaConfigurationRef branch from f25a17c to f3a2bed Compare January 29, 2024 14:19
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@rzvoncek rzvoncek merged commit a6271b4 into main Jan 29, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a field to reference a MedusaConfiguration resource in the K8ssandraCluster API
2 participants