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

OVA: generate random names for NFS pv and PVS used for migration #757

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

bkhizgiy
Copy link
Member

An issue has been identified where manually constructed names for PVCs lead to migration failures, especially during restarts or when reusing the same plan names. This occurs because of conflicts with existing PVCs. To address this, the implementation now utilizes GeneratedName to ensure unique naming and prevent collisions. Correspondingly, the cleanup process has been changed to accommodate these changes.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

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

See analysis details on SonarCloud

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

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

Comparison is base (a55e08e) 0.00% compared to head (b8cb81e) 16.92%.
Report is 211 commits behind head on main.

Files Patch % Lines
pkg/controller/plan/kubevirt.go 0.00% 35 Missing ⚠️
pkg/controller/plan/migration.go 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main     #757       +/-   ##
=========================================
+ Coverage      0   16.92%   +16.92%     
=========================================
  Files         0       88       +88     
  Lines         0    17877    +17877     
=========================================
+ Hits          0     3025     +3025     
- Misses        0    14607    +14607     
- Partials      0      245      +245     
Flag Coverage Δ
unittests 16.92% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Name: pvcName,
Namespace: r.Plan.Spec.TargetNamespace,
Labels: labels,
GenerateName: pvcNamePrefix,
Copy link
Member

Choose a reason for hiding this comment

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

you can call getEntityPrefixName here directly I think

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

+1 for this approach
edit: there's a typo in the title of the PR, randon -> random

pkg/controller/plan/kubevirt.go Outdated Show resolved Hide resolved
@bkhizgiy bkhizgiy changed the title OVA: generate randon names for NFS pv and PVS used for migration OVA: generate random names for NFS pv and PVS used for migration Feb 22, 2024
Signed-off-by: Bella Khizgiyaev <[email protected]>
Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

it feels like we're still putting too much "effort" to generate the prefix which is less important when the postfix is generated but we can check that separately

@ahadas ahadas merged commit 5419af5 into kubev2v:main Feb 22, 2024
11 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.

3 participants