spidernet-io / spiderpool

Underlay and RDMA network solution of the Kubernetes, for bare metal, VM and any public cloud
https://spidernet-io.github.io/spiderpool/
Apache License 2.0
503 stars 72 forks source link

spiderclaimparameter: add webhook to verify the create and update #3668

Closed cyclinder closed 4 days ago

cyclinder commented 5 days ago

Thanks for contributing!

What type of PR is this?

What this PR does / why we need it:

spiderclaimparameter: add webhook to verify the create and update

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

root@10-20-1-200:/home/spiderpool# kubectl apply -f scp.yaml
The SpiderClaimParameter "test1" is invalid: Spec.StaticNics.[1]: Invalid value: v2beta1.StaticNic{MultusConfigName:"calico1", Namespace:"default"}: error get spidermultusconfig {calico1 default}: spidermultusconfigs.spiderpool.spidernet.io "calico1" not found
codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.16%. Comparing base (d854624) to head (15af7ad). Report is 4 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/spidernet-io/spiderpool/pull/3668/graphs/tree.svg?width=650&height=150&src=pr&token=YKXY2E4Q8G&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io)](https://app.codecov.io/gh/spidernet-io/spiderpool/pull/3668?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) ```diff @@ Coverage Diff @@ ## main #3668 +/- ## ======================================= Coverage 81.16% 81.16% ======================================= Files 50 50 Lines 4391 4391 ======================================= Hits 3564 3564 Misses 670 670 Partials 157 157 ``` | [Flag](https://app.codecov.io/gh/spidernet-io/spiderpool/pull/3668/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/spidernet-io/spiderpool/pull/3668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) | `81.16% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#carryforward-flags-in-the-pull-request-comment) to find out more.
weizhoublue commented 5 days ago

没有 E2E ,至少 需要 把 E2E 设计 提到 doc

cyclinder commented 5 days ago

这个改变已经写了E2E