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

feat: enable specify localDiskName for localdiskclaim #1089

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

AmazingPangWei
Copy link
Contributor

What this PR does / why we need it:

#1087

Special notes for your reviewer:

Does this PR introduce a user-facing change?

feat: enable specify localDiskName for localdiskclaim

@codecov-commenter
Copy link

Codecov Report

Merging #1089 (00dada5) into main (8511e8d) will decrease coverage by 1.61%.
Report is 39 commits behind head on main.
The diff coverage is 5.74%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main    #1089      +/-   ##
==========================================
- Coverage   42.15%   40.55%   -1.61%     
==========================================
  Files          24       24              
  Lines        1587     1662      +75     
==========================================
+ Hits          669      674       +5     
- Misses        846      914      +68     
- Partials       72       74       +2     
Files Changed Coverage Δ
...manager/builder/localdiskvolume/localdiskvolume.go 45.97% <0.00%> (-4.66%) ⬇️
...nager/controller/localdisk/localdisk_controller.go 38.83% <0.00%> (-3.72%) ⬇️
...manager/handler/localdiskvolume/localdiskvolume.go 8.87% <0.00%> (-0.46%) ⬇️
pkg/local-disk-manager/filter/filter_disk.go 60.21% <4.76%> (-16.18%) ⬇️
.../local-disk-manager/handler/localdisk/localdisk.go 80.32% <18.18%> (-6.16%) ⬇️
...k-manager/handler/localdiskclaim/localdiskclaim.go 68.03% <40.00%> (-1.20%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines 192 to 193
Available().
HasNotReserved().
Copy link
Member

Choose a reason for hiding this comment

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

what will happen if localdiskname is matched but other attrributes are not? is this disk can be assigned directly to a disk claim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the logic of all conditions is AND.

@@ -72,6 +72,9 @@ type DiskClaimDescription struct {

// Capacity of the disk in bytes
Capacity int64 `json:"capacity,omitempty"`

// LocalDiskName for specifying LocalDisk
LocalDiskName string `json:"localDiskName,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

should be array of LocalDiskName?

Copy link
Contributor Author

@AmazingPangWei AmazingPangWei Sep 4, 2023

Choose a reason for hiding this comment

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

It's a good idea, but it may conflict with NodeName property. So in my view, localDiskName is fine.

Copy link
Member

Choose a reason for hiding this comment

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

it may be possible to specify multiple LocalDisk per node, right?

Signed-off-by: 庞玮 <pangwei@qianxin.com>
庞玮 added 3 commits September 6, 2023 17:41
Signed-off-by: 庞玮 <pangwei@qianxin.com>
Signed-off-by: 庞玮 <pangwei@qianxin.com>
@AmazingPangWei
Copy link
Contributor Author

I've updated this pr. New properties, localDiskNames and devicePaths, can be specified in localdiskclaim now.

Review again plz.

@SSmallMonster
Copy link
Member

lgtm

thanks for the contribution!!

@SSmallMonster SSmallMonster merged commit 4c71987 into hwameistor:main Sep 7, 2023
5 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.

None yet

4 participants