Repository: spidernet-io/spiderpool
Pull request #1281 (2023-01-16 10:45:23)

Refactor IPAM
  - Bump golang version 1.19 -> 1.20.
  - Use rand.New(NewSource(seed) to replace rand.Seed(seed).
  - Simplifie IPAM steps and reduce the number of API Server requests. In addition, a lot of debug logs are added.
  - Start the informers with SpiderReservedIP and some Kubernetes's native resources for cache querying.
  - Remove the mutating webhook of SpiderEndpoint.

Signed-off-by: iiiceoo <ziqian.xue@daocloud.io>


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [4 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.9%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.9% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [52 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![11.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '11.8%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [11.8% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


codecov[bot]: # [Codecov](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) Report
> Merging [#1281](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) (f4b9fa5) into [main](https://codecov.io/gh/spidernet-io/spiderpool/commit/c40f8003405bde8a04e5a54f0fd9f58878165848?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) (c40f800) will **decrease** coverage by `3.73%`.
> The diff coverage is `38.54%`.

[![Impacted file tree graph](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281/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://codecov.io/gh/spidernet-io/spiderpool/pull/1281?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    #1281      +/-   ##
==========================================
- Coverage   50.24%   46.52%   -3.73%     
==========================================
  Files          45       45              
  Lines        4661     4673      +12     
==========================================
- Hits         2342     2174     -168     
- Misses       2287     2467     +180     
  Partials       32       32              
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `46.52% <38.54%> (-3.73%)` | :arrow_down: |

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.

| [Impacted Files](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io) | Coverage Δ | |
|---|---|---|
| [pkg/ippoolmanager/ippool\_manager.go](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#diff-cGtnL2lwcG9vbG1hbmFnZXIvaXBwb29sX21hbmFnZXIuZ28=) | `0.00% <0.00%> (ø)` | |
| [pkg/ippoolmanager/utils.go](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#diff-cGtnL2lwcG9vbG1hbmFnZXIvdXRpbHMuZ28=) | `0.00% <0.00%> (ø)` | |
| [...orkloadendpointmanager/workloadendpoint\_manager.go](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#diff-cGtnL3dvcmtsb2FkZW5kcG9pbnRtYW5hZ2VyL3dvcmtsb2FkZW5kcG9pbnRfbWFuYWdlci5nbw==) | `2.75% <0.00%> (-92.88%)` | :arrow_down: |
| [pkg/limiter/queue.go](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#diff-cGtnL2xpbWl0ZXIvcXVldWUuZ28=) | `98.56% <100.00%> (+0.21%)` | :arrow_up: |
| [pkg/workloadendpointmanager/config.go](https://codecov.io/gh/spidernet-io/spiderpool/pull/1281?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spidernet-io#diff-cGtnL3dvcmtsb2FkZW5kcG9pbnRtYW5hZ2VyL2NvbmZpZy5nbw==) | `60.00% <0.00%> (-40.00%)` | :arrow_down: |

sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [54 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![11.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '11.9%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [11.9% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [53 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![11.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '11.8%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [11.8% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.4%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.4% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.4%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.4% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [13 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.4%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.4% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [11 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.3%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.3% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.3%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.3% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.2%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.2% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.2%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.2% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.2%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.2% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [9 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.1%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.1% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.2%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.2% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.2%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.2% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![13.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '13.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [13.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.7%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.7% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.7%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.7% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.5%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.5% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.5%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.5% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)


sonarcloud[bot]: SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=spidernet-io_spiderpool&pullRequest=1281)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [![E](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/E-16px.png 'E')](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT) [2 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL) [10 Code Smells](https://sonarcloud.io/project/issues?id=spidernet-io_spiderpool&pullRequest=1281&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281) No Coverage information  
[![12.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png '12.0%')](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list) [12.0% Duplication](https://sonarcloud.io/component_measures?id=spidernet-io_spiderpool&pullRequest=1281&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/.github/workflows/auto-nightly-ci.yaml b/.github/workflows/auto-nightly-ci.yaml
index a762ee072..80d6bd720 100644
--- a/.github/workflows/auto-nightly-ci.yaml
+++ b/.github/workflows/auto-nightly-ci.yaml
@@ -205,7 +205,7 @@ jobs:
       - name: Setup Golang
         uses: actions/setup-go@v3
         with:
-          go-version: 1.19.0
+          go-version: 1.20.0
           id: go
 
       # https://github.com/helm/kind-action
diff --git a/.github/workflows/lint-golang.yaml b/.github/workflows/lint-golang.yaml
index 4d53a5ab1..f65f54b43 100644
--- a/.github/workflows/lint-golang.yaml
+++ b/.github/workflows/lint-golang.yaml
@@ -82,7 +82,7 @@ jobs:
       - name: Install Go
         uses: actions/setup-go@v3
         with:
-          go-version: 1.19.0
+          go-version: 1.20.0
 
       - name: Checkout code
         uses: actions/checkout@v3
@@ -138,7 +138,7 @@ jobs:
       - name: Install Go
         uses: actions/setup-go@v3
         with:
-          go-version: 1.19.0
+          go-version: 1.20.0
 
       - name: Checkout code
         uses: actions/checkout@v3
@@ -192,7 +192,7 @@ jobs:
       - name: Install Go
         uses: actions/setup-go@v3
         with:
-          go-version: 1.19.0
+          go-version: 1.20.0
 
       - name: Checkout code
         uses: actions/checkout@v3
diff --git a/Makefile.version b/Makefile.version
index 761f1ef20..e687a256d 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,2 +1,2 @@
-GO_VERSION := 1.19
+GO_VERSION := 1.20
 GINKGO_VERSION := 2.1.3
diff --git a/charts/spiderpool/crds/spiderpool.spidernet.io_spiderendpoints.yaml b/charts/spiderpool/crds/spiderpool.spidernet.io_spiderendpoints.yaml
index befdb7b50..55dbd6705 100644
--- a/charts/spiderpool/crds/spiderpool.spidernet.io_spiderendpoints.yaml
+++ b/charts/spiderpool/crds/spiderpool.spidernet.io_spiderendpoints.yaml
@@ -180,6 +180,9 @@ spec:
                 type: string
               ownerControllerType:
                 type: string
+            required:
+            - ownerControllerName
+            - ownerControllerType
             type: object
         type: object
     served: true
diff --git a/charts/spiderpool/templates/tls.yaml b/charts/spiderpool/templates/tls.yaml
index 486f91425..55139e995 100644
--- a/charts/spiderpool/templates/tls.yaml
+++ b/charts/spiderpool/templates/tls.yaml
@@ -88,32 +88,6 @@ webhooks:
     resources:
     - spiderreservedips
   sideEffects: None
-- admissionReviewVersions:
-  - v1
-  clientConfig:
-    service:
-      name: {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
-      namespace: {{ .Release.Namespace }}
-      path: /mutate-spiderpool-spidernet-io-v1-spiderendpoint
-      port: {{ .Values.spiderpoolController.webhookPort }}
-    {{- if (eq .Values.spiderpoolController.tls.method "provided") }}
-    caBundle: {{ .Values.spiderpoolController.tls.provided.tlsCa | required "missing spiderpoolController.tls.provided.tlsCa" }}
-    {{- else if (eq .Values.spiderpoolController.tls.method "auto") }}
-    caBundle: {{ .ca.Cert | b64enc }}
-    {{- end }}
-  failurePolicy: Fail
-  name: spiderendpoint.spiderpool.spidernet.io
-  rules:
-  - apiGroups:
-    - spiderpool.spidernet.io
-    apiVersions:
-    - v1
-    operations:
-    - CREATE
-    - UPDATE
-    resources:
-    - spiderendpoints
-  sideEffects: None
 ---
 apiVersion: admissionregistration.k8s.io/v1
 kind: ValidatingWebhookConfiguration
diff --git a/cmd/spiderpool-agent/cmd/config.go b/cmd/spiderpool-agent/cmd/config.go
index d3ece3fd3..798b34be9 100644
--- a/cmd/spiderpool-agent/cmd/config.go
+++ b/cmd/spiderpool-agent/cmd/config.go
@@ -51,14 +51,13 @@ var envInfo = []envConf{
 	{"SPIDERPOOL_ENABLED_METRIC", "false", false, nil, &agentContext.Cfg.EnabledMetric, nil},
 	{"SPIDERPOOL_HEALTH_PORT", "5710", true, &agentContext.Cfg.HttpPort, nil, nil},
 	{"SPIDERPOOL_METRIC_HTTP_PORT", "5711", true, &agentContext.Cfg.MetricHttpPort, nil, nil},
-	{"SPIDERPOOL_UPDATE_CR_MAX_RETRIES", "3", false, nil, nil, &agentContext.Cfg.UpdateCRMaxRetries},
-	{"SPIDERPOOL_UPDATE_CR_RETRY_UNIT_TIME", "300", false, nil, nil, &agentContext.Cfg.UpdateCRRetryUnitTime},
+	{"SPIDERPOOL_UPDATE_CR_MAX_RETRIES", "4", false, nil, nil, &agentContext.Cfg.UpdateCRMaxRetries},
+	{"SPIDERPOOL_UPDATE_CR_RETRY_UNIT_TIME", "50", false, nil, nil, &agentContext.Cfg.UpdateCRRetryUnitTime},
 	{"SPIDERPOOL_WORKLOADENDPOINT_MAX_HISTORY_RECORDS", "100", true, nil, nil, &agentContext.Cfg.WorkloadEndpointMaxHistoryRecords},
 	{"SPIDERPOOL_IPPOOL_MAX_ALLOCATED_IPS", "5000", true, nil, nil, &agentContext.Cfg.IPPoolMaxAllocatedIPs},
 	{"SPIDERPOOL_GOPS_LISTEN_PORT", "5712", false, &agentContext.Cfg.GopsListenPort, nil, nil},
 	{"SPIDERPOOL_PYROSCOPE_PUSH_SERVER_ADDRESS", "", false, &agentContext.Cfg.PyroscopeAddress, nil, nil},
 	{"SPIDERPOOL_LIMITER_MAX_QUEUE_SIZE", "1000", true, nil, nil, &agentContext.Cfg.LimiterMaxQueueSize},
-	{"SPIDERPOOL_LIMITER_MAX_WAIT_TIME", "15", true, nil, nil, &agentContext.Cfg.LimiterMaxWaitTime},
 	{"SPIDERPOOL_ENABLED_STATEFULSET", "true", true, nil, &agentContext.Cfg.EnableStatefulSet, nil},
 	{"SPIDERPOOL_WAIT_SUBNET_POOL_TIME_IN_SECOND", "1", false, nil, nil, &agentContext.Cfg.WaitSubnetPoolTime},
 	{"GOLANG_ENV_MAXPROCS", "8", false, nil, nil, &agentContext.Cfg.GoMaxProcs},
@@ -91,7 +90,6 @@ type Config struct {
 	WaitSubnetPoolTime                int
 
 	LimiterMaxQueueSize int
-	LimiterMaxWaitTime  int
 
 	// configmap
 	IpamUnixSocketPath                string   `yaml:"ipamUnixSocketPath"`
diff --git a/cmd/spiderpool-agent/cmd/crd_manager.go b/cmd/spiderpool-agent/cmd/crd_manager.go
index ab2f1502b..be4547195 100644
--- a/cmd/spiderpool-agent/cmd/crd_manager.go
+++ b/cmd/spiderpool-agent/cmd/crd_manager.go
@@ -4,13 +4,12 @@
 package cmd
 
 import (
+	"strconv"
+
 	// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
 	// to ensure that exec-entrypoint and run can make use of them.
 	_ "k8s.io/client-go/plugin/pkg/client/auth"
 
-	appsv1 "k8s.io/api/apps/v1"
-	batchv1 "k8s.io/api/batch/v1"
-	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
 	clientgoscheme "k8s.io/client-go/kubernetes/scheme"
@@ -33,25 +32,21 @@ func newCRDManager() (ctrl.Manager, error) {
 		MetricsBindAddress:     "0",
 		HealthProbeBindAddress: "0",
 		ClientDisableCacheFor: []client.Object{
-			&corev1.Node{},
-			&corev1.Namespace{},
-			&corev1.Pod{},
-			&appsv1.Deployment{},
-			&appsv1.StatefulSet{},
-			&appsv1.ReplicaSet{},
-			&appsv1.DaemonSet{},
-			&batchv1.Job{},
-			&batchv1.CronJob{},
+			&spiderpoolv1.SpiderSubnet{},
 			&spiderpoolv1.SpiderIPPool{},
 			&spiderpoolv1.SpiderEndpoint{},
-			&spiderpoolv1.SpiderReservedIP{},
-			&spiderpoolv1.SpiderSubnet{},
 		},
 	})
-
 	if err != nil {
 		return nil, err
 	}
 
+	if err := mgr.GetFieldIndexer().IndexField(agentContext.InnerCtx, &spiderpoolv1.SpiderReservedIP{}, "spec.ipVersion", func(raw client.Object) []string {
+		reservedIP := raw.(*spiderpoolv1.SpiderReservedIP)
+		return []string{strconv.FormatInt(*reservedIP.Spec.IPVersion, 10)}
+	}); err != nil {
+		return nil, err
+	}
+
 	return mgr, nil
 }
diff --git a/cmd/spiderpool-agent/cmd/daemon.go b/cmd/spiderpool-agent/cmd/daemon.go
index bc30b0dc8..a6188b08b 100644
--- a/cmd/spiderpool-agent/cmd/daemon.go
+++ b/cmd/spiderpool-agent/cmd/daemon.go
@@ -17,7 +17,6 @@ import (
 	"github.com/google/gops/agent"
 	"github.com/pyroscope-io/client/pyroscope"
 
-	"github.com/spidernet-io/spiderpool/pkg/config"
 	"github.com/spidernet-io/spiderpool/pkg/ipam"
 	"github.com/spidernet-io/spiderpool/pkg/ippoolmanager"
 	"github.com/spidernet-io/spiderpool/pkg/limiter"
@@ -127,21 +126,26 @@ func DaemonMain() {
 	initAgentServiceManagers(agentContext.InnerCtx)
 
 	logger.Info("Begin to initialize IPAM")
-	limiterMaxWaitTime := time.Duration(agentContext.Cfg.LimiterMaxWaitTime) * time.Second
-	ipam, err := ipam.NewIPAM(&ipam.IPAMConfig{
-		EnableIPv4:               agentContext.Cfg.EnableIPv4,
-		EnableIPv6:               agentContext.Cfg.EnableIPv6,
-		ClusterDefaultIPv4IPPool: agentContext.Cfg.ClusterDefaultIPv4IPPool,
-		ClusterDefaultIPv6IPPool: agentContext.Cfg.ClusterDefaultIPv6IPPool,
-		EnableSpiderSubnet:       agentContext.Cfg.EnableSpiderSubnet,
-		EnableStatefulSet:        agentContext.Cfg.EnableStatefulSet,
-		LimiterConfig: limiter.LimiterConfig{
-			MaxQueueSize: &agentContext.Cfg.LimiterMaxQueueSize,
-			MaxWaitTime:  &limiterMaxWaitTime,
+	ipam, err := ipam.NewIPAM(
+		ipam.IPAMConfig{
+			EnableIPv4:               agentContext.Cfg.EnableIPv4,
+			EnableIPv6:               agentContext.Cfg.EnableIPv6,
+			ClusterDefaultIPv4IPPool: agentContext.Cfg.ClusterDefaultIPv4IPPool,
+			ClusterDefaultIPv6IPPool: agentContext.Cfg.ClusterDefaultIPv6IPPool,
+			EnableSpiderSubnet:       agentContext.Cfg.EnableSpiderSubnet,
+			EnableStatefulSet:        agentContext.Cfg.EnableStatefulSet,
+			OperationRetries:         agentContext.Cfg.UpdateCRMaxRetries,
+			OperationGapDuration:     time.Duration(agentContext.Cfg.WaitSubnetPoolTime) * time.Second,
+			LimiterConfig:            limiter.LimiterConfig{MaxQueueSize: &agentContext.Cfg.LimiterMaxQueueSize},
 		},
-		OperationRetries:     agentContext.Cfg.UpdateCRMaxRetries,
-		OperationGapDuration: time.Duration(agentContext.Cfg.WaitSubnetPoolTime) * time.Second,
-	}, agentContext.IPPoolManager, agentContext.EndpointManager, agentContext.NodeManager, agentContext.NSManager, agentContext.PodManager, agentContext.StsManager, agentContext.SubnetManager)
+		agentContext.IPPoolManager,
+		agentContext.EndpointManager,
+		agentContext.NodeManager,
+		agentContext.NSManager,
+		agentContext.PodManager,
+		agentContext.StsManager,
+		agentContext.SubnetManager,
+	)
 	if nil != err {
 		logger.Fatal(err.Error())
 	}
@@ -250,11 +254,6 @@ func WatchSignal(sigCh chan os.Signal) {
 }
 
 func initAgentServiceManagers(ctx context.Context) {
-	updateCRConfig := config.UpdateCRConfig{
-		MaxConflictRetries:    agentContext.Cfg.UpdateCRMaxRetries,
-		ConflictRetryUnitTime: time.Duration(agentContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
-	}
-
 	logger.Debug("Begin to initialize Node manager")
 	nodeManager, err := nodemanager.NewNodeManager(agentContext.CRDManager.GetClient())
 	if err != nil {
@@ -297,7 +296,6 @@ func initAgentServiceManagers(ctx context.Context) {
 			MaxHistoryRecords:     &agentContext.Cfg.WorkloadEndpointMaxHistoryRecords,
 		},
 		agentContext.CRDManager.GetClient(),
-		agentContext.PodManager,
 	)
 	if err != nil {
 		logger.Fatal(err.Error())
@@ -312,10 +310,15 @@ func initAgentServiceManagers(ctx context.Context) {
 	agentContext.RIPManager = rIPManager
 
 	logger.Debug("Begin to initialize IPPool manager")
-	ipPoolManager, err := ippoolmanager.NewIPPoolManager(&ippoolmanager.IPPoolManagerConfig{
-		UpdateCRConfig:  updateCRConfig,
-		MaxAllocatedIPs: agentContext.Cfg.IPPoolMaxAllocatedIPs,
-	}, agentContext.CRDManager, agentContext.PodManager)
+	ipPoolManager, err := ippoolmanager.NewIPPoolManager(
+		ippoolmanager.IPPoolManagerConfig{
+			MaxConflictRetries:    agentContext.Cfg.UpdateCRMaxRetries,
+			ConflictRetryUnitTime: time.Duration(agentContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
+			MaxAllocatedIPs:       &agentContext.Cfg.IPPoolMaxAllocatedIPs,
+		},
+		agentContext.CRDManager.GetClient(),
+		agentContext.RIPManager,
+	)
 	if err != nil {
 		logger.Fatal(err.Error())
 	}
@@ -323,9 +326,14 @@ func initAgentServiceManagers(ctx context.Context) {
 
 	if agentContext.Cfg.EnableSpiderSubnet {
 		logger.Debug("Begin to initialize Subnet manager")
-		subnetManager, err := subnetmanager.NewSubnetManager(&subnetmanager.SubnetManagerConfig{
-			UpdateCRConfig: updateCRConfig,
-		}, agentContext.CRDManager, agentContext.IPPoolManager, agentContext.RIPManager)
+		subnetManager, err := subnetmanager.NewSubnetManager(
+			subnetmanager.SubnetManagerConfig{
+				MaxConflictRetries:    agentContext.Cfg.UpdateCRMaxRetries,
+				ConflictRetryUnitTime: time.Duration(agentContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
+			},
+			agentContext.CRDManager.GetClient(),
+			agentContext.IPPoolManager,
+		)
 		if err != nil {
 			logger.Fatal(err.Error())
 		}
diff --git a/cmd/spiderpool-controller/cmd/config.go b/cmd/spiderpool-controller/cmd/config.go
index 5b93ee2db..1a792c23b 100644
--- a/cmd/spiderpool-controller/cmd/config.go
+++ b/cmd/spiderpool-controller/cmd/config.go
@@ -59,8 +59,8 @@ var envInfo = []envConf{
 	{"SPIDERPOOL_SUBNET_APPLICATION_CONTROLLER_WORKERS", "5", true, nil, nil, &controllerContext.Cfg.SubnetAppControllerWorkers},
 	{"SPIDERPOOL_SUBNET_INFORMER_WORKERS", "3", true, nil, nil, &controllerContext.Cfg.SubnetInformerWorkers},
 	{"SPIDERPOOL_SUBNET_INFORMER_MAX_WORKQUEUE_LENGTH", "10000", false, nil, nil, &controllerContext.Cfg.SubnetInformerMaxWorkqueueLength},
-	{"SPIDERPOOL_UPDATE_CR_MAX_RETRIES", "3", false, nil, nil, &controllerContext.Cfg.UpdateCRMaxRetries},
-	{"SPIDERPOOL_UPDATE_CR_RETRY_UNIT_TIME", "300", false, nil, nil, &controllerContext.Cfg.UpdateCRRetryUnitTime},
+	{"SPIDERPOOL_UPDATE_CR_MAX_RETRIES", "4", false, nil, nil, &controllerContext.Cfg.UpdateCRMaxRetries},
+	{"SPIDERPOOL_UPDATE_CR_RETRY_UNIT_TIME", "50", false, nil, nil, &controllerContext.Cfg.UpdateCRRetryUnitTime},
 	{"SPIDERPOOL_GC_IP_ENABLED", "true", true, nil, &gcIPConfig.EnableGCIP, nil},
 	{"SPIDERPOOL_GC_TERMINATING_POD_IP_ENABLED", "true", true, nil, &gcIPConfig.EnableGCForTerminatingPod, nil},
 	{"SPIDERPOOL_GC_IP_WORKER_NUM", "3", true, nil, nil, &gcIPConfig.ReleaseIPWorkerNum},
diff --git a/cmd/spiderpool-controller/cmd/crd_manager.go b/cmd/spiderpool-controller/cmd/crd_manager.go
index 02f454ee8..9d6df8c71 100644
--- a/cmd/spiderpool-controller/cmd/crd_manager.go
+++ b/cmd/spiderpool-controller/cmd/crd_manager.go
@@ -9,12 +9,11 @@ import (
 	"net/http"
 	"path"
 	"strconv"
+
 	// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
 	// to ensure that exec-entrypoint and run can make use of them.
 	_ "k8s.io/client-go/plugin/pkg/client/auth"
 
-	appsv1 "k8s.io/api/apps/v1"
-	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
 	clientgoscheme "k8s.io/client-go/kubernetes/scheme"
@@ -44,16 +43,19 @@ func newCRDManager() (ctrl.Manager, error) {
 		MetricsBindAddress:     "0",
 		HealthProbeBindAddress: "0",
 		ClientDisableCacheFor: []client.Object{
-			&corev1.Node{},
-			&corev1.Namespace{},
-			&corev1.Pod{},
-			&appsv1.Deployment{},
-			&appsv1.StatefulSet{},
+			&spiderpoolv1.SpiderSubnet{},
 			&spiderpoolv1.SpiderIPPool{},
 			&spiderpoolv1.SpiderEndpoint{},
-			&spiderpoolv1.SpiderReservedIP{}},
+		},
 	})
-	if nil != err {
+	if err != nil {
+		return nil, err
+	}
+
+	if err := mgr.GetFieldIndexer().IndexField(controllerContext.InnerCtx, &spiderpoolv1.SpiderReservedIP{}, "spec.ipVersion", func(raw client.Object) []string {
+		reservedIP := raw.(*spiderpoolv1.SpiderReservedIP)
+		return []string{strconv.FormatInt(*reservedIP.Spec.IPVersion, 10)}
+	}); err != nil {
 		return nil, err
 	}
 
diff --git a/cmd/spiderpool-controller/cmd/daemon.go b/cmd/spiderpool-controller/cmd/daemon.go
index efa31008c..150a4774e 100644
--- a/cmd/spiderpool-controller/cmd/daemon.go
+++ b/cmd/spiderpool-controller/cmd/daemon.go
@@ -18,7 +18,6 @@ import (
 	"k8s.io/client-go/kubernetes"
 	ctrl "sigs.k8s.io/controller-runtime"
 
-	"github.com/spidernet-io/spiderpool/pkg/config"
 	"github.com/spidernet-io/spiderpool/pkg/constant"
 	"github.com/spidernet-io/spiderpool/pkg/election"
 	"github.com/spidernet-io/spiderpool/pkg/event"
@@ -211,11 +210,6 @@ func WatchSignal(sigCh chan os.Signal) {
 }
 
 func initControllerServiceManagers(ctx context.Context) {
-	updateCRConfig := config.UpdateCRConfig{
-		MaxConflictRetries:    controllerContext.Cfg.UpdateCRMaxRetries,
-		ConflictRetryUnitTime: time.Duration(controllerContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
-	}
-
 	logger.Debug("Begin to initialize spiderpool-controller leader election")
 	initSpiderControllerLeaderElect(controllerContext.InnerCtx)
 
@@ -261,18 +255,12 @@ func initControllerServiceManagers(ctx context.Context) {
 			MaxHistoryRecords:     &controllerContext.Cfg.WorkloadEndpointMaxHistoryRecords,
 		},
 		controllerContext.CRDManager.GetClient(),
-		controllerContext.PodManager,
 	)
 	if err != nil {
 		logger.Fatal(err.Error())
 	}
 	controllerContext.EndpointManager = endpointManager
 
-	logger.Debug("Begin to set up Endpoint webhook")
-	if err := (&workloadendpointmanager.WorkloadEndpointWebhook{}).SetupWebhookWithManager(controllerContext.CRDManager); err != nil {
-		logger.Fatal(err.Error())
-	}
-
 	logger.Debug("Begin to initialize ReservedIP manager")
 	rIPManager, err := reservedipmanager.NewReservedIPManager(controllerContext.CRDManager.GetClient())
 	if err != nil {
@@ -290,22 +278,20 @@ func initControllerServiceManagers(ctx context.Context) {
 	}
 
 	logger.Debug("Begin to initialize IPPool manager")
-	ipPoolManager, err := ippoolmanager.NewIPPoolManager(&ippoolmanager.IPPoolManagerConfig{
-		UpdateCRConfig:  updateCRConfig,
-		MaxAllocatedIPs: controllerContext.Cfg.IPPoolMaxAllocatedIPs,
-	}, controllerContext.CRDManager, controllerContext.PodManager)
+	ipPoolManager, err := ippoolmanager.NewIPPoolManager(
+		ippoolmanager.IPPoolManagerConfig{
+			MaxConflictRetries:    controllerContext.Cfg.UpdateCRMaxRetries,
+			ConflictRetryUnitTime: time.Duration(controllerContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
+			MaxAllocatedIPs:       &controllerContext.Cfg.IPPoolMaxAllocatedIPs,
+		},
+		controllerContext.CRDManager.GetClient(),
+		controllerContext.RIPManager,
+	)
 	if err != nil {
 		logger.Fatal(err.Error())
 	}
 	controllerContext.IPPoolManager = ipPoolManager
 
-	go func() {
-		logger.Debug("Starting IPPool manager")
-		if err := ipPoolManager.Start(controllerContext.InnerCtx); err != nil {
-			logger.Fatal(err.Error())
-		}
-	}()
-
 	logger.Debug("Begin to set up IPPool webhook")
 	if err := (&ippoolmanager.IPPoolWebhook{
 		Client:             controllerContext.CRDManager.GetClient(),
@@ -319,9 +305,14 @@ func initControllerServiceManagers(ctx context.Context) {
 
 	if controllerContext.Cfg.EnableSpiderSubnet {
 		logger.Debug("Begin to initialize Subnet manager")
-		subnetManager, err := subnetmanager.NewSubnetManager(&subnetmanager.SubnetManagerConfig{
-			UpdateCRConfig: updateCRConfig,
-		}, controllerContext.CRDManager, controllerContext.IPPoolManager, controllerContext.RIPManager)
+		subnetManager, err := subnetmanager.NewSubnetManager(
+			subnetmanager.SubnetManagerConfig{
+				MaxConflictRetries:    controllerContext.Cfg.UpdateCRMaxRetries,
+				ConflictRetryUnitTime: time.Duration(controllerContext.Cfg.UpdateCRRetryUnitTime) * time.Millisecond,
+			},
+			controllerContext.CRDManager.GetClient(),
+			controllerContext.IPPoolManager,
+		)
 		if err != nil {
 			logger.Fatal(err.Error())
 		}
@@ -409,7 +400,7 @@ func setupInformers() {
 	}
 
 	logger.Info("Begin to set up IPPool informer")
-	ipPoolController := ippoolmanager.NewIPPoolController(controllerContext.CRDManager.GetClient(),
+	ipPoolController := ippoolmanager.NewIPPoolController(
 		ippoolmanager.IPPoolControllerConfig{
 			EnableIPv4:                    controllerContext.Cfg.EnableIPv4,
 			EnableIPv6:                    controllerContext.Cfg.EnableIPv6,
@@ -420,6 +411,8 @@ func setupInformers() {
 			WorkQueueRequeueDelayDuration: time.Duration(controllerContext.Cfg.WorkQueueRequeueDelayDuration) * time.Second,
 			WorkQueueMaxRetries:           controllerContext.Cfg.WorkQueueMaxRetries,
 		},
+		controllerContext.CRDManager.GetClient(),
+		controllerContext.RIPManager,
 	)
 	err = ipPoolController.SetupInformer(controllerContext.InnerCtx, crdClient, controllerContext.Leader)
 	if nil != err {
diff --git a/cmd/spiderpool/cmd/command_add.go b/cmd/spiderpool/cmd/command_add.go
index 8a0c62153..6b29d98f6 100644
--- a/cmd/spiderpool/cmd/command_add.go
+++ b/cmd/spiderpool/cmd/command_add.go
@@ -4,11 +4,13 @@
 package cmd
 
 import (
+	"context"
 	"fmt"
 	"net"
 	"os"
 	"path/filepath"
 	"runtime/debug"
+	"time"
 
 	"github.com/containernetworking/cni/pkg/skel"
 	"github.com/containernetworking/cni/pkg/types"
@@ -115,7 +117,10 @@ func CmdAdd(args *skel.CmdArgs) (err error) {
 		CleanGateway:      conf.IPAM.CleanGateway,
 	}
 
-	params := daemonset.NewPostIpamIPParams()
+	ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
+	defer cancel()
+
+	params := daemonset.NewPostIpamIPParamsWithContext(ctx)
 	params.SetIpamAddArgs(ipamAddArgs)
 	ipamResponse, err := spiderpoolAgentAPI.Daemonset.PostIpamIP(params)
 	if nil != err {
diff --git a/go.mod b/go.mod
index d56336590..5a687f141 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/spidernet-io/spiderpool
 
-go 1.19
+go 1.20
 
 require (
 	github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
@@ -48,7 +48,6 @@ require (
 
 require (
 	github.com/agiledragon/gomonkey/v2 v2.9.0
-	github.com/golang/mock v1.6.0
 	github.com/moby/moby v23.0.1+incompatible
 	github.com/openkruise/kruise-api v1.3.0
 	github.com/prometheus/client_golang v1.14.0
diff --git a/go.sum b/go.sum
index 0e4cff3fd..f6bdc253d 100644
--- a/go.sum
+++ b/go.sum
@@ -269,7 +269,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
 github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
-github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
 github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
diff --git a/images/spiderpool-agent/Dockerfile b/images/spiderpool-agent/Dockerfile
index e91eca394..2ddb3f857 100644
--- a/images/spiderpool-agent/Dockerfile
+++ b/images/spiderpool-agent/Dockerfile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: Apache-2.0
 
 ARG BASE_IMAGE=ghcr.io/spidernet-io/spiderpool/spiderpool-base:1f8330482d25b58d2ae26bc6252e20384bac92ad
-ARG GOLANG_IMAGE=docker.io/library/golang:1.19@sha256:d72a2944621f0f4027983e094bdf9464d26459c17efe732320043b84c91e51e7
+ARG GOLANG_IMAGE=docker.io/library/golang:1.20@sha256:f69d47fedd3b2ebd23bcf473c0b78522ebbc1823f06b7d47f45f04a30bdc901d
 
 #======= build bin ==========
 FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} as builder
diff --git a/images/spiderpool-base/Dockerfile b/images/spiderpool-base/Dockerfile
index 042cca1fb..05f4dc71c 100644
--- a/images/spiderpool-base/Dockerfile
+++ b/images/spiderpool-base/Dockerfile
@@ -3,7 +3,7 @@
 
 # docker buildx build -t testbase:latest --platform=linux/arm64,linux/amd64 --output type=docker .
 
-ARG GOLANG_IMAGE=docker.io/library/golang:1.19@sha256:d72a2944621f0f4027983e094bdf9464d26459c17efe732320043b84c91e51e7
+ARG GOLANG_IMAGE=docker.io/library/golang:1.20@sha256:f69d47fedd3b2ebd23bcf473c0b78522ebbc1823f06b7d47f45f04a30bdc901d
 ARG UBUNTU_IMAGE=docker.io/library/ubuntu:20.04@sha256:bea6d19168bbfd6af8d77c2cc3c572114eb5d113e6f422573c93cb605a0e2ffb
 
 
diff --git a/images/spiderpool-controller/Dockerfile b/images/spiderpool-controller/Dockerfile
index 6089e4a83..bb2e0875a 100644
--- a/images/spiderpool-controller/Dockerfile
+++ b/images/spiderpool-controller/Dockerfile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: Apache-2.0
 
 ARG BASE_IMAGE=ghcr.io/spidernet-io/spiderpool/spiderpool-base:1f8330482d25b58d2ae26bc6252e20384bac92ad
-ARG GOLANG_IMAGE=docker.io/library/golang:1.19@sha256:d72a2944621f0f4027983e094bdf9464d26459c17efe732320043b84c91e51e7
+ARG GOLANG_IMAGE=docker.io/library/golang:1.20@sha256:f69d47fedd3b2ebd23bcf473c0b78522ebbc1823f06b7d47f45f04a30bdc901d
 
 #======= build bin ==========
 FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} as builder
diff --git a/pkg/config/config.go b/pkg/config/config.go
deleted file mode 100644
index c81d30c41..000000000
--- a/pkg/config/config.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package config
-
-import "time"
-
-type UpdateCRConfig struct {
-	MaxConflictRetries    int
-	ConflictRetryUnitTime time.Duration
-}
diff --git a/pkg/gcmanager/scanAll_IPPool.go b/pkg/gcmanager/scanAll_IPPool.go
index c35cc460e..58fc47128 100644
--- a/pkg/gcmanager/scanAll_IPPool.go
+++ b/pkg/gcmanager/scanAll_IPPool.go
@@ -159,7 +159,7 @@ func (s *SpiderGC) executeScanAll(ctx context.Context) {
 				}
 
 				// case: The pod in IPPool's ip-allocationDetail is also exist in k8s, but the IP corresponding allocation containerID is different with wep current containerID
-				allocation, _ := workloadendpointmanager.RetrieveIPAllocation(poolIPAllocation.ContainerID, poolIPAllocation.NIC, false, endpoint)
+				allocation := workloadendpointmanager.RetrieveIPAllocation(poolIPAllocation.ContainerID, poolIPAllocation.NIC, endpoint)
 				if allocation == nil {
 					wrappedLog := scanAllLogger.With(zap.String("gc-reason", "IPPoolAllocation containerID is different with wep current containerID"))
 					// release IP but no need to remove wep finalizer
diff --git a/pkg/ipam/config.go b/pkg/ipam/config.go
index 54eeb6e97..921daf3a5 100644
--- a/pkg/ipam/config.go
+++ b/pkg/ipam/config.go
@@ -29,12 +29,16 @@ type IPAMConfig struct {
 	LimiterConfig        limiter.LimiterConfig
 }
 
-func (c *IPAMConfig) getClusterDefaultPool(ctx context.Context, nic string, cleanGateway bool) (*ToBeAllocated, error) {
-	logger := logutils.FromContext(ctx)
+func setDefaultsForIPAMConfig(config IPAMConfig) IPAMConfig {
+	return config
+}
 
+func (c *IPAMConfig) getClusterDefaultPool(ctx context.Context, nic string, cleanGateway bool) (*ToBeAllocated, error) {
 	if len(c.ClusterDefaultIPv4IPPool) == 0 && len(c.ClusterDefaultIPv6IPPool) == 0 {
 		return nil, fmt.Errorf("%w, no pool selection rules of any type are specified", constant.ErrNoAvailablePool)
 	}
+
+	logger := logutils.FromContext(ctx)
 	logger.Info("Use IPPools from cluster default pools")
 
 	t := &ToBeAllocated{
@@ -57,7 +61,7 @@ func (c *IPAMConfig) getClusterDefaultPool(ctx context.Context, nic string, clea
 	return t, nil
 }
 
-func (c *IPAMConfig) checkIPVersionEnable(ctx context.Context, tt []*ToBeAllocated) error {
+func (c *IPAMConfig) checkIPVersionEnable(ctx context.Context, tt ToBeAllocateds) error {
 	logger := logutils.FromContext(ctx)
 
 	if c.EnableIPv4 && !c.EnableIPv6 {
@@ -96,7 +100,7 @@ func (c *IPAMConfig) filterPoolMisspecified(ctx context.Context, t *ToBeAllocate
 			v6Count++
 			invalidPoolCandidates = append(invalidPoolCandidates, pc)
 		} else {
-			logger.Sugar().Warnf("IPv%d is disabled, ignoring to allocate IPv4 IP to NIC %s from IPPool %v", pc.IPVersion, t.NIC, pc.Pools)
+			logger.Sugar().Debugf("IPv%d is disabled, ignoring to allocate IPv%d IP to NIC %s from IPPool %v", pc.IPVersion, pc.IPVersion, t.NIC, pc.Pools)
 		}
 	}
 	t.PoolCandidates = invalidPoolCandidates
diff --git a/pkg/ipam/convert.go b/pkg/ipam/convert.go
index f9426ef70..b33d55c81 100644
--- a/pkg/ipam/convert.go
+++ b/pkg/ipam/convert.go
@@ -4,7 +4,6 @@
 package ipam
 
 import (
-	"encoding/json"
 	"strings"
 
 	"github.com/asaskevich/govalidator"
@@ -207,67 +206,24 @@ func convertOAIRoutesToSpecRoutes(oaiRoutes []*models.Route) []spiderpoolv1.Rout
 	return routes
 }
 
-func genIPAssignmentAnnotation(ips []*models.IPConfig) (map[string]string, error) {
-	nicToValue := map[string]*types.AnnoPodAssignedEthxValue{}
-	for _, ip := range ips {
-		if v, ok := nicToValue[*ip.Nic]; ok {
-			if *ip.Version == constant.IPv4 {
-				v.IPv4 = *ip.Address
-				v.IPv4Pool = ip.IPPool
-				v.Vlan = ip.Vlan
-			} else {
-				v.IPv6 = *ip.Address
-				v.IPv6Pool = ip.IPPool
-				v.Vlan = ip.Vlan
-			}
-			continue
-		}
-
-		if *ip.Version == constant.IPv4 {
-			nicToValue[*ip.Nic] = &types.AnnoPodAssignedEthxValue{
-				NIC:      *ip.Nic,
-				IPv4:     *ip.Address,
-				IPv4Pool: ip.IPPool,
-				Vlan:     ip.Vlan,
-			}
-		} else {
-			nicToValue[*ip.Nic] = &types.AnnoPodAssignedEthxValue{
-				NIC:      *ip.Nic,
-				IPv6:     *ip.Address,
-				IPv6Pool: ip.IPPool,
-				Vlan:     ip.Vlan,
-			}
-		}
-	}
-
-	podAnnotations := map[string]string{}
-	for nic, anno := range nicToValue {
-		b, err := json.Marshal(anno)
-		if err != nil {
-			return nil, err
-		}
-		podAnnotations[constant.AnnotationPre+"/assigned-"+nic] = string(b)
-	}
-
-	return podAnnotations, nil
-}
-
-func GroupIPDetails(containerID string, details []spiderpoolv1.IPAllocationDetail) map[string][]types.IPAndCID {
-	poolToIPAndCIDs := map[string][]types.IPAndCID{}
+func GroupIPDetails(containerID, nodeName string, details []spiderpoolv1.IPAllocationDetail) PoolNameToIPAndCIDs {
+	pics := PoolNameToIPAndCIDs{}
 	for _, d := range details {
 		if d.IPv4 != nil {
-			poolToIPAndCIDs[*d.IPv4Pool] = append(poolToIPAndCIDs[*d.IPv4Pool], types.IPAndCID{
+			pics[*d.IPv4Pool] = append(pics[*d.IPv4Pool], types.IPAndCID{
 				IP:          strings.Split(*d.IPv4, "/")[0],
 				ContainerID: containerID,
+				Node:        nodeName,
 			})
 		}
 		if d.IPv6 != nil {
-			poolToIPAndCIDs[*d.IPv6Pool] = append(poolToIPAndCIDs[*d.IPv6Pool], types.IPAndCID{
+			pics[*d.IPv6Pool] = append(pics[*d.IPv6Pool], types.IPAndCID{
 				IP:          strings.Split(*d.IPv6, "/")[0],
 				ContainerID: containerID,
+				Node:        nodeName,
 			})
 		}
 	}
 
-	return poolToIPAndCIDs
+	return pics
 }
diff --git a/pkg/ipam/ipam.go b/pkg/ipam/ipam.go
index 8f8b53e45..03f66979a 100644
--- a/pkg/ipam/ipam.go
+++ b/pkg/ipam/ipam.go
@@ -5,16 +5,17 @@ package ipam
 
 import (
 	"context"
-	"errors"
 	"fmt"
 	"strings"
 	"sync"
 	"time"
 
 	"go.uber.org/multierr"
+	"go.uber.org/zap"
 	corev1 "k8s.io/api/core/v1"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"k8s.io/apimachinery/pkg/labels"
 	utilerrors "k8s.io/apimachinery/pkg/util/errors"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
@@ -24,7 +25,6 @@ import (
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 	"github.com/spidernet-io/spiderpool/pkg/limiter"
 	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"github.com/spidernet-io/spiderpool/pkg/metric"
 	"github.com/spidernet-io/spiderpool/pkg/namespacemanager"
 	"github.com/spidernet-io/spiderpool/pkg/nodemanager"
 	"github.com/spidernet-io/spiderpool/pkg/podmanager"
@@ -43,54 +43,63 @@ type IPAM interface {
 }
 
 type ipam struct {
-	config        *IPAMConfig
-	ipamLimiter   limiter.Limiter
-	ipPoolManager ippoolmanager.IPPoolManager
-	weManager     workloadendpointmanager.WorkloadEndpointManager
-	nodeManager   nodemanager.NodeManager
-	nsManager     namespacemanager.NamespaceManager
-	podManager    podmanager.PodManager
-	stsManager    statefulsetmanager.StatefulSetManager
-	subnetManager subnetmanager.SubnetManager
+	config      IPAMConfig
+	ipamLimiter limiter.Limiter
+
+	ipPoolManager   ippoolmanager.IPPoolManager
+	endpointManager workloadendpointmanager.WorkloadEndpointManager
+	nodeManager     nodemanager.NodeManager
+	nsManager       namespacemanager.NamespaceManager
+	podManager      podmanager.PodManager
+	stsManager      statefulsetmanager.StatefulSetManager
+	subnetManager   subnetmanager.SubnetManager
+
+	rollbacks sync.Map
 }
 
-func NewIPAM(c *IPAMConfig, ipPoolManager ippoolmanager.IPPoolManager, weManager workloadendpointmanager.WorkloadEndpointManager, nodeManager nodemanager.NodeManager,
-	nsManager namespacemanager.NamespaceManager, podManager podmanager.PodManager, stsManager statefulsetmanager.StatefulSetManager, subnetMgr subnetmanager.SubnetManager) (IPAM, error) {
-	if c == nil {
-		return nil, errors.New("ipam config must be specified")
-	}
+func NewIPAM(
+	config IPAMConfig,
+	ipPoolManager ippoolmanager.IPPoolManager,
+	endpointManager workloadendpointmanager.WorkloadEndpointManager,
+	nodeManager nodemanager.NodeManager,
+	nsManager namespacemanager.NamespaceManager,
+	podManager podmanager.PodManager,
+	stsManager statefulsetmanager.StatefulSetManager,
+	subnetManager subnetmanager.SubnetManager,
+) (IPAM, error) {
 	if ipPoolManager == nil {
-		return nil, errors.New("ippool manager must be specified")
+		return nil, fmt.Errorf("ippool manager %w", constant.ErrMissingRequiredParam)
 	}
-	if weManager == nil {
-		return nil, errors.New("endpoint manager must be specified")
+	if endpointManager == nil {
+		return nil, fmt.Errorf("endpoint manager %w", constant.ErrMissingRequiredParam)
 	}
 	if nodeManager == nil {
-		return nil, errors.New("node manager must be specified")
+		return nil, fmt.Errorf("node manager %w", constant.ErrMissingRequiredParam)
 	}
 	if nsManager == nil {
-		return nil, errors.New("namespace manager must be specified")
+		return nil, fmt.Errorf("namespace manager %w", constant.ErrMissingRequiredParam)
 	}
 	if podManager == nil {
-		return nil, errors.New("pod manager must be specified")
+		return nil, fmt.Errorf("pod manager %w", constant.ErrMissingRequiredParam)
 	}
 	if stsManager == nil {
-		return nil, errors.New("statefulset manager must be specified")
+		return nil, fmt.Errorf("statefulset manager %w", constant.ErrMissingRequiredParam)
 	}
-	if c.EnableSpiderSubnet && subnetMgr == nil {
-		return nil, errors.New("subnet manager must be specified")
+	if config.EnableSpiderSubnet && subnetManager == nil {
+		return nil, fmt.Errorf("subnet manager %w", constant.ErrMissingRequiredParam)
 	}
 
 	return &ipam{
-		config:        c,
-		ipamLimiter:   limiter.NewLimiter(c.LimiterConfig),
-		ipPoolManager: ipPoolManager,
-		weManager:     weManager,
-		nodeManager:   nodeManager,
-		nsManager:     nsManager,
-		podManager:    podManager,
-		stsManager:    stsManager,
-		subnetManager: subnetMgr,
+		config:          setDefaultsForIPAMConfig(config),
+		ipamLimiter:     limiter.NewLimiter(config.LimiterConfig),
+		ipPoolManager:   ipPoolManager,
+		endpointManager: endpointManager,
+		nodeManager:     nodeManager,
+		nsManager:       nsManager,
+		podManager:      podManager,
+		stsManager:      stsManager,
+		subnetManager:   subnetManager,
+		rollbacks:       sync.Map{},
 	}, nil
 }
 
@@ -104,21 +113,30 @@ func (i *ipam) Allocate(ctx context.Context, addArgs *models.IpamAddArgs) (*mode
 	}
 	podStatus, allocatable := podmanager.CheckPodStatus(pod)
 	if !allocatable {
-		return nil, fmt.Errorf("%s Pod %s/%s cannot allocate IP addresees", strings.ToLower(string(podStatus)), *addArgs.PodNamespace, *addArgs.PodName)
+		return nil, fmt.Errorf("%s Pod %s/%s cannot allocate IP addresees", strings.ToLower(string(podStatus)), pod.Namespace, pod.Name)
 	}
+	logger.Sugar().Debugf("Get Pod with status %s", podStatus)
 
-	endpoint, err := i.weManager.GetEndpointByName(ctx, *addArgs.PodNamespace, *addArgs.PodName)
+	podTopController, err := i.podManager.GetPodTopController(ctx, pod)
+	if nil != err {
+		return nil, fmt.Errorf("failed to get the top controller of the Pod %s/%s: %v", pod.Namespace, pod.Name, err)
+	}
+	logger.Sugar().Debugf("%s %s/%s is the top controller of the Pod", podTopController.Kind, podTopController.Namespace, podTopController.Name)
+
+	endpoint, err := i.endpointManager.GetEndpointByName(ctx, pod.Namespace, pod.Name)
 	if client.IgnoreNotFound(err) != nil {
-		return nil, fmt.Errorf("failed to get Endpoint %s/%s: %v", *addArgs.PodNamespace, *addArgs.PodName, err)
+		return nil, fmt.Errorf("failed to get Endpoint %s/%s: %v", pod.Namespace, pod.Name, err)
 	}
 
-	podTopController, err := i.podManager.GetPodTopController(ctx, pod)
-	if nil != err {
-		return nil, err
+	if endpoint == nil {
+		logger.Sugar().Debugf("Get Endpoint %s/%s", pod.Namespace, pod.Name)
+	} else {
+		logger.Debug("No Endpoint")
 	}
 
 	if i.config.EnableStatefulSet && podTopController.Kind == constant.KindStatefulSet {
-		addResp, err := i.retrieveStsIPAllocation(ctx, *addArgs.ContainerID, *addArgs.IfName, pod, endpoint)
+		logger.Info("Retrieve the IP allocation of StatefulSet")
+		addResp, err := i.retrieveStsIPAllocation(ctx, *addArgs.ContainerID, pod, endpoint)
 		if err != nil {
 			return nil, fmt.Errorf("failed to retrieve the IP allocation of StatefulSet %s/%s: %w", podTopController.Namespace, podTopController.Name, err)
 		}
@@ -126,6 +144,7 @@ func (i *ipam) Allocate(ctx context.Context, addArgs *models.IpamAddArgs) (*mode
 			return addResp, nil
 		}
 	} else {
+		logger.Debug("Try to retrieve the existing IP allocation in multi-NIC mode")
 		addResp, err := i.retrieveMultiNICIPAllocation(ctx, *addArgs.ContainerID, *addArgs.IfName, endpoint)
 		if err != nil {
 			return nil, fmt.Errorf("failed to retrieve the IP allocation in multi-NIC mode: %w", err)
@@ -135,6 +154,7 @@ func (i *ipam) Allocate(ctx context.Context, addArgs *models.IpamAddArgs) (*mode
 		}
 	}
 
+	logger.Info("Allocate IP addresses in standard mode")
 	addResp, err := i.allocateInStandardMode(ctx, addArgs, pod, endpoint, podTopController)
 	if err != nil {
 		return nil, fmt.Errorf("failed to allocate IP addresses in standard mode: %w", err)
@@ -143,49 +163,46 @@ func (i *ipam) Allocate(ctx context.Context, addArgs *models.IpamAddArgs) (*mode
 	return addResp, nil
 }
 
-func (i *ipam) retrieveStsIPAllocation(ctx context.Context, containerID, nic string, pod *corev1.Pod, endpoint *spiderpoolv1.SpiderEndpoint) (*models.IpamAddResponse, error) {
+func (i *ipam) retrieveStsIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod, endpoint *spiderpoolv1.SpiderEndpoint) (*models.IpamAddResponse, error) {
 	logger := logutils.FromContext(ctx)
 
+	// The first allocation.
 	if endpoint == nil {
-		logger.Debug("Endpoint not found, do not retrieve anything for StatefulSet and try to allocate IP in standard mode")
+		logger.Debug("Endpoint not found, try to allocate IP in standard mode instead of retrieving")
 		return nil, nil
 	}
 
-	// There's no possible that a StatefulSet Pod Endpoint's field 'Status.Current' is nil.
+	// The rollback records is missing and the last allocation failed.
 	if endpoint.Status.Current == nil {
-		logger.Sugar().Warnf("SpiderEndpoint '%s/%s' doesn't have current IP allocation, try to re-allocate", endpoint.Namespace, endpoint.Name)
+		logger.Warn("Endpoint doesn't have current IP allocation, try to re-allocate")
 		return nil, nil
 	}
 
-	logger.Info("Retrieve the IP allocation of StatefulSet")
-
-	// validation
-	for _, allocation := range endpoint.Status.Current.IPs {
-		if i.config.EnableIPv4 && allocation.IPv4 == nil || i.config.EnableIPv6 && allocation.IPv6 == nil {
-			return nil, fmt.Errorf("StatefulSet pod has legacy failure allocation %v", allocation)
-		}
+	// Failed to allocate any IP addresses in the last allocation.
+	if len(endpoint.Status.Current.IPs) == 0 {
+		return nil, nil
 	}
 
-	nicMatched := false
-	ips, routes := convertIPDetailsToIPConfigsAndAllRoutes(endpoint.Status.Current.IPs)
-	for _, c := range ips {
-		if *c.Nic == nic {
-			if err := i.ipPoolManager.UpdateAllocatedIPs(ctx, containerID, pod, *c); err != nil {
-				return nil, fmt.Errorf("failed to update StatefulSet's previous IP allocation records in IPPool %s: %w", c.IPPool, err)
-			}
-			nicMatched = true
+	// Check again in case cmdDel() cannot be complete under some special
+	// circumstances. Or the IP version config of spiderpool is modified.
+	for _, d := range endpoint.Status.Current.IPs {
+		if i.config.EnableIPv4 && d.IPv4 == nil ||
+			i.config.EnableIPv6 && d.IPv6 == nil {
+			return nil, fmt.Errorf("the Pod of StatefulSet has legacy failure allocation %+v", d)
 		}
 	}
 
-	if !nicMatched {
-		return nil, fmt.Errorf("nic %s do not match the current IP allocation of StatefulSet", nic)
+	// Concurrently refresh the IP records of the IPPools.
+	if err := i.reallocateIPPoolIPRecords(ctx, containerID, pod.Spec.NodeName, endpoint); err != nil {
+		return nil, err
 	}
 
-	// Refresh Endpoint current IP allocation.
-	if err := i.weManager.ReallocateCurrentIPAllocation(ctx, containerID, pod.Spec.NodeName, pod.Namespace, pod.Name); err != nil {
+	// Refresh the current IP allocation of the Endpoint.
+	if err := i.endpointManager.ReallocateCurrentIPAllocation(ctx, containerID, pod.Spec.NodeName, endpoint); err != nil {
 		return nil, fmt.Errorf("failed to update the current IP allocation of StatefulSet: %w", err)
 	}
 
+	ips, routes := convertIPDetailsToIPConfigsAndAllRoutes(endpoint.Status.Current.IPs)
 	addResp := &models.IpamAddResponse{
 		Ips:    ips,
 		Routes: routes,
@@ -195,11 +212,51 @@ func (i *ipam) retrieveStsIPAllocation(ctx context.Context, containerID, nic str
 	return addResp, nil
 }
 
+func (i *ipam) reallocateIPPoolIPRecords(ctx context.Context, containerID, nodeName string, endpoint *spiderpoolv1.SpiderEndpoint) error {
+	logger := logutils.FromContext(ctx)
+
+	pics := GroupIPDetails(containerID, nodeName, endpoint.Status.Current.IPs)
+	tickets := pics.Pools()
+	if err := i.ipamLimiter.AcquireTicket(ctx, tickets...); err != nil {
+		return fmt.Errorf("failed to queue correctly: %v", err)
+	}
+	defer i.ipamLimiter.ReleaseTicket(ctx, tickets...)
+
+	errCh := make(chan error, len(pics))
+	wg := sync.WaitGroup{}
+	wg.Add(len(pics))
+
+	for p, ics := range pics {
+		go func(poolName string, ipAndCIDs []types.IPAndCID) {
+			defer wg.Done()
+
+			if err := i.ipPoolManager.UpdateAllocatedIPs(ctx, poolName, ipAndCIDs); err != nil {
+				logger.Warn(err.Error())
+				errCh <- err
+				return
+			}
+			logger.Sugar().Infof("Succeed to re-allocate IP addresses %+v from IPPool %s", ipAndCIDs, poolName)
+		}(p, ics)
+	}
+	wg.Wait()
+	close(errCh)
+
+	var errs []error
+	for err := range errCh {
+		errs = append(errs, err)
+	}
+
+	if len(errs) != 0 {
+		return fmt.Errorf("failed to re-allocate all allocated IP addresses %+v: %w", pics, utilerrors.NewAggregate(errs))
+	}
+
+	return nil
+}
+
 func (i *ipam) retrieveMultiNICIPAllocation(ctx context.Context, containerID, nic string, endpoint *spiderpoolv1.SpiderEndpoint) (*models.IpamAddResponse, error) {
 	logger := logutils.FromContext(ctx)
-	logger.Debug("Try to retrieve the existing IP allocation in multi-NIC mode")
 
-	allocation, _ := workloadendpointmanager.RetrieveIPAllocation(containerID, nic, false, endpoint)
+	allocation := workloadendpointmanager.RetrieveIPAllocation(containerID, nic, endpoint)
 	if allocation == nil {
 		logger.Debug("Nothing retrieved to allocate")
 		return nil, nil
@@ -217,45 +274,43 @@ func (i *ipam) retrieveMultiNICIPAllocation(ctx context.Context, containerID, ni
 
 func (i *ipam) allocateInStandardMode(ctx context.Context, addArgs *models.IpamAddArgs, pod *corev1.Pod, endpoint *spiderpoolv1.SpiderEndpoint, podController types.PodTopController) (*models.IpamAddResponse, error) {
 	logger := logutils.FromContext(ctx)
-	logger.Info("Allocate IP addresses in standard mode")
 
-	toBeAllocatedSet, err := i.genToBeAllocatedSet(ctx, *addArgs.IfName, addArgs.DefaultIPV4IPPool, addArgs.DefaultIPV6IPPool, addArgs.CleanGateway, pod, podController)
+	logger.Debug("Parse custom routes")
+	customRoutes, err := getCustomRoutes(pod)
+	if err != nil {
+		return nil, err
+	}
+
+	logger.Debug("Generate IPPool candidates")
+	toBeAllocatedSet, err := i.genToBeAllocatedSet(ctx, addArgs, pod, podController)
 	if err != nil {
 		return nil, err
 	}
 
 	// TODO(iiiceoo): Comment why containerID should be written first.
 	if endpoint == nil {
-		endpoint, err = i.weManager.MarkIPAllocation(ctx, *addArgs.ContainerID, pod)
+		logger.Sugar().Infof("First sandbox of Pod is being created, mark the IP allocation")
+		endpoint, err = i.endpointManager.MarkIPAllocation(ctx, *addArgs.ContainerID, pod, podController)
 		if err != nil {
 			return nil, fmt.Errorf("failed to mark IP allocation: %v", err)
 		}
 	} else {
-		if err := i.weManager.ReMarkIPAllocation(ctx, *addArgs.ContainerID, pod, endpoint); err != nil {
+		logger.Sugar().Infof("Sandbox has changed, remarking the IP allocation with the new container ID")
+		if err := i.endpointManager.ReMarkIPAllocation(ctx, *addArgs.ContainerID, endpoint, pod); err != nil {
 			return nil, fmt.Errorf("failed to remark IP allocation: %v", err)
 		}
 	}
 
-	results, err := i.allocateForAllNICs(ctx, toBeAllocatedSet, *addArgs.ContainerID, endpoint, pod)
-	resIPs, resRoutes := convertResultsToIPConfigsAndAllRoutes(results)
+	results, err := i.allocateForAllNICs(ctx, toBeAllocatedSet, *addArgs.ContainerID, customRoutes, endpoint, pod, podController)
 	if err != nil {
-		// If there are any other errors that might have been thrown at Allocate
-		// after the allocateForAllInterfaces is called, use defer.
-		if len(resIPs) != 0 {
-			if rollbackErr := i.release(ctx, *addArgs.ContainerID, convertResultsToIPDetails(results)); rollbackErr != nil {
-				metric.IpamAllocationRollbackFailureCounts.Add(ctx, 1)
-				logger.Sugar().Warnf("Failed to roll back the allocated IPs: %v", rollbackErr)
-				return nil, err
-			}
+		if len(results) != 0 {
+			logger.Sugar().Warnf("Failed to allocate IP addresses for all NICs, record incomplete IP allocation results for rollback: %+v", results)
+			i.addRollback(*addArgs.ContainerID, results)
 		}
-
-		if err := i.weManager.ClearCurrentIPAllocation(ctx, *addArgs.ContainerID, endpoint); err != nil {
-			logger.Sugar().Warnf("Failed to clear the current IP allocation: %v", err)
-		}
-
 		return nil, err
 	}
 
+	resIPs, resRoutes := convertResultsToIPConfigsAndAllRoutes(results)
 	addResp := &models.IpamAddResponse{
 		Ips:    resIPs,
 		Routes: resRoutes,
@@ -265,192 +320,210 @@ func (i *ipam) allocateInStandardMode(ctx context.Context, addArgs *models.IpamA
 	return addResp, nil
 }
 
-func (i *ipam) genToBeAllocatedSet(ctx context.Context, nic string, defaultIPV4IPPool, defaultIPV6IPPool []string, cleanGateway bool, pod *corev1.Pod, podController types.PodTopController) ([]*ToBeAllocated, error) {
+func (i *ipam) genToBeAllocatedSet(ctx context.Context, addArgs *models.IpamAddArgs, pod *corev1.Pod, podController types.PodTopController) (ToBeAllocateds, error) {
 	logger := logutils.FromContext(ctx)
 
-	preliminary, err := i.getPoolCandidates(ctx, nic, defaultIPV4IPPool, defaultIPV6IPPool, cleanGateway, pod, podController)
+	logger.Debug("Select original IPPools through pool selection rules")
+	preliminary, err := i.getPoolCandidates(ctx, addArgs, pod, podController)
 	if err != nil {
 		return nil, err
 	}
 	logger.Sugar().Infof("Preliminary IPPool candidates: %s", preliminary)
 
-	if err := i.config.checkIPVersionEnable(ctx, preliminary); err != nil {
+	logger.Debug("Precheck IPPool candidates")
+	if err := i.precheckPoolCandidates(ctx, preliminary); err != nil {
 		return nil, err
 	}
+	logger.Sugar().Infof("Prechecked IPPool candidates: %s", preliminary)
 
+	logger.Debug("Filter out IPPool candidates")
 	if err := i.filterPoolCandidates(ctx, preliminary, pod); err != nil {
 		return nil, err
 	}
 	logger.Sugar().Infof("Filtered IPPool candidates: %s", preliminary)
 
-	if err := i.verifyPoolCandidates(ctx, preliminary); err != nil {
+	logger.Debug("Verify IPPool candidates")
+	if err := i.verifyPoolCandidates(preliminary); err != nil {
 		return nil, err
 	}
-	logger.Info("All IPPool candidates valid")
+	logger.Info("All IPPool candidates are valid")
 
 	return preliminary, nil
 }
 
-func (i *ipam) allocateForAllNICs(ctx context.Context, tt []*ToBeAllocated, containerID string, endpoint *spiderpoolv1.SpiderEndpoint, pod *corev1.Pod) ([]*AllocationResult, error) {
+func (i *ipam) allocateForAllNICs(ctx context.Context, tt ToBeAllocateds, containerID string, customRoutes []*models.Route, endpoint *spiderpoolv1.SpiderEndpoint, pod *corev1.Pod, podController types.PodTopController) ([]*AllocationResult, error) {
 	logger := logutils.FromContext(ctx)
 
-	customRoutes, err := getCustomRoutes(ctx, pod)
+	logger.Sugar().Debugf("Concurrently allocate IP addresses from all IPPool candidates")
+	results, err := i.allocateIPsFromAllCandidates(ctx, tt, containerID, pod, podController)
 	if err != nil {
-		return nil, err
+		return results, err
 	}
 
-	var allResults []*AllocationResult
-	for _, t := range tt {
-		oneResults, err := i.allocateForOneNIC(ctx, t, containerID, &customRoutes, endpoint, pod)
-		if len(oneResults) != 0 {
-			allResults = append(allResults, oneResults...)
-		}
-		if err != nil {
-			return allResults, err
-		}
-	}
-	if len(customRoutes) != 0 {
-		logger.Sugar().Warnf("Invalid custom routes: %v", customRoutes)
+	logger.Sugar().Debugf("Group custom routes by IP allocation results")
+	if err := groupCustomRoutes(ctx, customRoutes, results); err != nil {
+		return results, fmt.Errorf("failed to group custom routes %+v: %v", customRoutes, err)
 	}
 
-	ips, _ := convertResultsToIPConfigsAndAllRoutes(allResults)
-	anno, err := genIPAssignmentAnnotation(ips)
-	if err != nil {
-		return allResults, fmt.Errorf("failed to generate IP assignment annotation: %v", err)
+	logger.Sugar().Debugf("Patch IP allocation detail to Endpoint %s/%s", endpoint.Namespace, endpoint.Name)
+	if err = i.endpointManager.PatchIPAllocation(ctx, &spiderpoolv1.PodIPAllocation{
+		ContainerID: containerID,
+		IPs:         convertResultsToIPDetails(results),
+	}, endpoint); err != nil {
+		return results, fmt.Errorf("failed to patch IP allocation detail to Endpoint %s/%s: %v", endpoint.Namespace, endpoint.Name, err)
 	}
 
-	if err := i.podManager.MergeAnnotations(ctx, pod.Namespace, pod.Name, anno); err != nil {
-		return allResults, fmt.Errorf("failed to merge IP assignment annotation: %w", err)
+	return results, nil
+}
+
+func (i *ipam) allocateIPsFromAllCandidates(ctx context.Context, tt ToBeAllocateds, containerID string, pod *corev1.Pod, podController types.PodTopController) ([]*AllocationResult, error) {
+	logger := logutils.FromContext(ctx)
+
+	tickets := tt.Pools()
+	if err := i.ipamLimiter.AcquireTicket(ctx, tickets...); err != nil {
+		return nil, fmt.Errorf("failed to queue correctly: %v", err)
 	}
+	defer i.ipamLimiter.ReleaseTicket(ctx, tickets...)
 
-	return allResults, nil
-}
+	n := len(tt.Candidates())
+	resultCh := make(chan *AllocationResult, n)
+	errCh := make(chan error, n)
+	wg := sync.WaitGroup{}
+	wg.Add(n)
 
-func (i *ipam) allocateForOneNIC(ctx context.Context, t *ToBeAllocated, containerID string, customRoutes *[]*models.Route, endpoint *spiderpoolv1.SpiderEndpoint, pod *corev1.Pod) ([]*AllocationResult, error) {
-	var results []*AllocationResult
-	for _, c := range t.PoolCandidates {
-		result, err := i.allocateIPFromPoolCandidates(ctx, c, t.NIC, containerID, t.CleanGateway, pod)
-		if err != nil {
-			return results, err
-		}
-		results = append(results, result)
+	for _, t := range tt {
+		for _, c := range t.PoolCandidates {
+			go func(candidate *PoolCandidate, nic string, cleanGateway bool) {
+				defer wg.Done()
+
+				clogger := logger.With(zap.String(
+					"AllocateHash",
+					fmt.Sprintf("%s-%d-%v", nic, candidate.IPVersion, candidate.Pools),
+				))
+
+				clogger.Sugar().Debugf("Try to allocate IPv%d IP address to NIC %s from IPPools %v", candidate.IPVersion, nic, candidate.Pools)
+				result, err := i.allocateIPFromCandidate(logutils.IntoContext(ctx, clogger), candidate, nic, containerID, cleanGateway, pod, podController)
+				if err != nil {
+					clogger.Warn(err.Error())
+					errCh <- err
+					return
+				}
 
-		routes, err := groupCustomRoutesByGW(ctx, customRoutes, result.IP)
-		if err != nil {
-			return results, fmt.Errorf("failed to group custom routes by gateway: %v", err)
-		}
-		result.Routes = append(result.Routes, routes...)
-
-		patch := convertResultsToIPDetails([]*AllocationResult{result})
-		if err = i.weManager.PatchIPAllocation(ctx, &spiderpoolv1.PodIPAllocation{
-			ContainerID: containerID,
-			IPs:         patch,
-		}, endpoint); err != nil {
-			return results, fmt.Errorf("failed to patch IP allocation detail %+v to Endpoint %s/%s: %v", patch, endpoint.Namespace, endpoint.Name, err)
+				resultCh <- result
+			}(c, t.NIC, t.CleanGateway)
 		}
 	}
+	wg.Wait()
+	close(resultCh)
+	close(errCh)
+
+	var results []*AllocationResult
+	for res := range resultCh {
+		results = append(results, res)
+	}
+
+	var errs []error
+	for err := range errCh {
+		errs = append(errs, err)
+	}
+
+	if len(errs) != 0 {
+		return results, utilerrors.NewAggregate(errs)
+	}
 
 	return results, nil
 }
 
-func (i *ipam) allocateIPFromPoolCandidates(ctx context.Context, c *PoolCandidate, nic, containerID string, cleanGateway bool, pod *corev1.Pod) (*AllocationResult, error) {
+func (i *ipam) allocateIPFromCandidate(ctx context.Context, c *PoolCandidate, nic, containerID string, cleanGateway bool, pod *corev1.Pod, podController types.PodTopController) (*AllocationResult, error) {
 	logger := logutils.FromContext(ctx)
 
-	// TODO(iiiceoo): Comment why queue up before allocating IP.
-	_, err := i.ipamLimiter.AcquireTicket(ctx, c.Pools...)
-	if err != nil {
-		logger.Sugar().Errorf("Failed to queue correctly: %v", err)
-	} else {
-		defer i.ipamLimiter.ReleaseTicket(ctx, c.Pools...)
-	}
-
 	var errs []error
 	var result *AllocationResult
 	for _, pool := range c.Pools {
-		ip, ipPool, err := i.ipPoolManager.AllocateIP(ctx, pool, containerID, nic, pod)
+		ip, err := i.ipPoolManager.AllocateIP(ctx, pool, containerID, nic, pod, podController)
 		if err != nil {
+			logger.Sugar().Warnf("Failed to allocate IPv%d IP address to NIC %s from IPPool %s: %v", c.IPVersion, nic, pool, err)
 			errs = append(errs, err)
-			logger.Sugar().Warnf("Failed to allocate IPv%d IP to %s from IPPool %s: %v", c.IPVersion, nic, pool, err)
 			continue
 		}
 
 		result = &AllocationResult{
 			IP:           ip,
 			CleanGateway: cleanGateway,
-			Routes:       convertSpecRoutesToOAIRoutes(nic, ipPool.Spec.Routes),
+			Routes:       convertSpecRoutesToOAIRoutes(nic, c.PToIPPool[pool].Spec.Routes),
 		}
-		logger.Sugar().Infof("Allocate IPv%d IP %s to %s from IPPool %s", c.IPVersion, *result.IP.Address, nic, pool)
+		logger.Sugar().Infof("Allocate IPv%d IP %s to NIC %s from IPPool %s", c.IPVersion, *result.IP.Address, nic, pool)
 		break
 	}
 
 	if len(errs) == len(c.Pools) {
-		return nil, fmt.Errorf("failed to allocate any IPv%d IP address to %s from IPPools %v: %w", c.IPVersion, nic, c.Pools, utilerrors.NewAggregate(errs))
+		return nil, fmt.Errorf("failed to allocate any IPv%d IP address to NIC %s from IPPools %v: %w", c.IPVersion, nic, c.Pools, utilerrors.NewAggregate(errs))
 	}
 
 	return result, nil
 }
 
-func (i *ipam) getPoolCandidates(ctx context.Context, nic string, netConfV4Pool, netConfV6Pool []string, cleanGateway bool, pod *corev1.Pod, podController types.PodTopController) ([]*ToBeAllocated, error) {
-	// Select candidate IPPools through the Pod annotations "ipam.spidernet.io/subnets" or "ipam.spidernet.io/subnet"
-	// if we enable to use SpiderSubnet feature
+func (i *ipam) getPoolCandidates(ctx context.Context, addArgs *models.IpamAddArgs, pod *corev1.Pod, podController types.PodTopController) (ToBeAllocateds, error) {
+	// If faature SpiderSubnet is enabled, select IPPool candidates through the
+	// Pod annotations "ipam.spidernet.io/subnet" or "ipam.spidernet.io/subnets".
 	if i.config.EnableSpiderSubnet {
-		fromSubnet, err := i.getPoolFromSubnetAnno(ctx, pod, nic, cleanGateway, podController)
+		fromSubnet, err := i.getPoolFromSubnetAnno(ctx, pod, *addArgs.IfName, addArgs.CleanGateway, podController)
 		if nil != err {
-			return nil, fmt.Errorf("failed to get IPPool from SpiderSubnet, error: %v", err)
+			return nil, fmt.Errorf("failed to get IPPool candidates from Subnet: %v", err)
 		}
 		if fromSubnet != nil {
-			return []*ToBeAllocated{fromSubnet}, nil
+			return ToBeAllocateds{fromSubnet}, nil
 		}
 	}
 
-	// Select candidate IPPools through the Pod annotation "ipam.spidernet.io/ippools".
+	// Select IPPool candidates through the Pod annotation "ipam.spidernet.io/ippools".
 	if anno, ok := pod.Annotations[constant.AnnoPodIPPools]; ok {
-		return getPoolFromPodAnnoPools(ctx, anno, nic)
+		return getPoolFromPodAnnoPools(ctx, anno, *addArgs.IfName)
 	}
 
-	// Select candidate IPPools through the Pod annotation "ipam.spidernet.io/ippool".
+	// Select IPPool candidates through the Pod annotation "ipam.spidernet.io/ippool".
 	if anno, ok := pod.Annotations[constant.AnnoPodIPPool]; ok {
-		t, err := getPoolFromPodAnnoPool(ctx, anno, nic, cleanGateway)
+		t, err := getPoolFromPodAnnoPool(ctx, anno, *addArgs.IfName, addArgs.CleanGateway)
 		if err != nil {
 			return nil, err
 		}
-		return []*ToBeAllocated{t}, nil
+		return ToBeAllocateds{t}, nil
 	}
 
-	// Select candidate IPPools through Cluster Default Subnet with Configmap Spiderpool-conf
-	// if we enable to use SpiderSubnet feature
+	// If faature SpiderSubnet is enabled, select IPPool candidates through the cluster
+	// default Subnet defined in Configmap spiderpool-conf.
 	if i.config.EnableSpiderSubnet {
-		fromClusterDefaultSubnet, err := i.getPoolFromClusterDefaultSubnet(ctx, pod, nic, cleanGateway, podController)
+		fromClusterDefaultSubnet, err := i.getPoolFromClusterDefaultSubnet(ctx, pod, *addArgs.IfName, addArgs.CleanGateway, podController)
 		if nil != err {
 			return nil, err
 		}
 		if fromClusterDefaultSubnet != nil {
-			return []*ToBeAllocated{fromClusterDefaultSubnet}, nil
+			return ToBeAllocateds{fromClusterDefaultSubnet}, nil
 		}
 	}
 
-	// Select candidate IPPools through the Namespace annotations
+	// Select IPPool candidates through the Namespace annotations
 	// "ipam.spidernet.io/defaultv4ippool" and "ipam.spidernet.io/defaultv6ippool".
-	t, err := i.getPoolFromNS(ctx, pod.Namespace, nic, cleanGateway)
+	t, err := i.getPoolFromNS(ctx, pod.Namespace, *addArgs.IfName, addArgs.CleanGateway)
 	if err != nil {
 		return nil, err
 	}
 	if t != nil {
-		return []*ToBeAllocated{t}, nil
+		return ToBeAllocateds{t}, nil
 	}
 
-	// Select candidate IPPools through CNI network configuration.
-	if t := getPoolFromNetConf(ctx, nic, netConfV4Pool, netConfV6Pool, cleanGateway); t != nil {
-		return []*ToBeAllocated{t}, nil
+	// Select IPPool candidates through CNI network configuration.
+	if t := getPoolFromNetConf(ctx, *addArgs.IfName, addArgs.DefaultIPV4IPPool, addArgs.DefaultIPV6IPPool, addArgs.CleanGateway); t != nil {
+		return ToBeAllocateds{t}, nil
 	}
 
-	// Select candidate IPPools through Configmap spiderpool-conf.
-	t, err = i.config.getClusterDefaultPool(ctx, nic, cleanGateway)
+	// Select IPPool candidates through Configmap spiderpool-conf.
+	t, err = i.config.getClusterDefaultPool(ctx, *addArgs.IfName, addArgs.CleanGateway)
 	if err != nil {
 		return nil, err
 	}
 
-	return []*ToBeAllocated{t}, nil
+	return ToBeAllocateds{t}, nil
 }
 
 func (i *ipam) getPoolFromSubnetAnno(ctx context.Context, pod *corev1.Pod, nic string, cleanGateway bool, podController types.PodTopController) (*ToBeAllocated, error) {
@@ -570,7 +643,7 @@ func (i *ipam) getPoolFromSubnetAnno(ctx context.Context, pod *corev1.Pod, nic s
 			defer wg.Done()
 
 			v4PoolCandidate, shouldCreateV4Pool, errV4 = findSubnetIPPool(client.MatchingLabels{
-				constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+				constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 				constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV4,
 				constant.LabelIPPoolOwnerSpiderSubnet:   subnetItem.IPv4[0],
 				constant.LabelIPPoolOwnerApplication:    subnetmanagercontrollers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
@@ -600,7 +673,7 @@ func (i *ipam) getPoolFromSubnetAnno(ctx context.Context, pod *corev1.Pod, nic s
 			defer wg.Done()
 
 			v6PoolCandidate, shouldCreateV6Pool, errV6 = findSubnetIPPool(client.MatchingLabels{
-				constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+				constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 				constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV6,
 				constant.LabelIPPoolOwnerSpiderSubnet:   subnetItem.IPv6[0],
 				constant.LabelIPPoolOwnerApplication:    subnetmanagercontrollers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
@@ -744,7 +817,7 @@ func (i *ipam) findOrApplyClusterSubnetDefaultIPPool(ctx context.Context, podCon
 			defer wg.Done()
 
 			matchLabels := client.MatchingLabels{
-				constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+				constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 				constant.LabelIPPoolOwnerSpiderSubnet:   clusterDefaultV4Subnet,
 				constant.LabelIPPoolOwnerApplication:    subnetmanagercontrollers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
 				constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV4,
@@ -766,7 +839,7 @@ func (i *ipam) findOrApplyClusterSubnetDefaultIPPool(ctx context.Context, podCon
 			defer wg.Done()
 
 			matchLabels := client.MatchingLabels{
-				constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+				constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 				constant.LabelIPPoolOwnerSpiderSubnet:   clusterDefaultV6Subnet,
 				constant.LabelIPPoolOwnerApplication:    subnetmanagercontrollers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
 				constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV6,
@@ -792,8 +865,6 @@ func (i *ipam) findOrApplyClusterSubnetDefaultIPPool(ctx context.Context, podCon
 }
 
 func (i *ipam) getPoolFromNS(ctx context.Context, namespace, nic string, cleanGateway bool) (*ToBeAllocated, error) {
-	logger := logutils.FromContext(ctx)
-
 	ns, err := i.nsManager.GetNamespaceByName(ctx, namespace)
 	if err != nil {
 		return nil, err
@@ -807,7 +878,9 @@ func (i *ipam) getPoolFromNS(ctx context.Context, namespace, nic string, cleanGa
 		return nil, nil
 	}
 
-	logger.Sugar().Infof("Use IPPools from Namespace annotation '%s'", constant.AnnotationPre+"/defaultv(4/6)ippool")
+	logger := logutils.FromContext(ctx)
+	logger.Sugar().Infof("Use IPPools from Namespace annotation '%s'", constant.AnnotationPre+"/default-ipv(4/6)-ippool")
+
 	t := &ToBeAllocated{
 		NIC:          nic,
 		CleanGateway: cleanGateway,
@@ -828,48 +901,75 @@ func (i *ipam) getPoolFromNS(ctx context.Context, namespace, nic string, cleanGa
 	return t, nil
 }
 
-func (i *ipam) filterPoolCandidates(ctx context.Context, tt []*ToBeAllocated, pod *corev1.Pod) error {
+func (i *ipam) precheckPoolCandidates(ctx context.Context, tt ToBeAllocateds) error {
 	logger := logutils.FromContext(ctx)
 
+	if err := i.config.checkIPVersionEnable(ctx, tt); err != nil {
+		return err
+	}
+
+	// TODO(iiiceoo): Use gorouting and sync.Map.
 	for _, t := range tt {
 		for _, c := range t.PoolCandidates {
-			var errs []error
-			var selectedPools []string
+			ptp := PoolNameToIPPool{}
 			for _, pool := range c.Pools {
-				if err := i.selectByPod(ctx, c.IPVersion, pool, pod); err != nil {
+				if _, ok := ptp[pool]; ok {
+					return fmt.Errorf("%w, duplicate candidate IPPool %s", constant.ErrWrongInput, pool)
+				}
+
+				logger.Sugar().Debugf("Get original candidate IPPool %s", pool)
+				ipPool, err := i.ipPoolManager.GetIPPoolByName(ctx, pool)
+				if err != nil {
+					return fmt.Errorf("failed to get original candidate IPPool %s: %v", pool, err)
+				}
+				ptp[pool] = ipPool
+			}
+			c.PToIPPool = ptp
+		}
+	}
+
+	return nil
+}
+
+func (i *ipam) filterPoolCandidates(ctx context.Context, tt ToBeAllocateds, pod *corev1.Pod) error {
+	logger := logutils.FromContext(ctx)
+
+	for _, t := range tt {
+		for _, c := range t.PoolCandidates {
+			var errs []error
+
+			for j := 0; j < len(c.Pools); j++ {
+				pool := c.Pools[j]
+				if err := i.selectByPod(ctx, c.IPVersion, c.PToIPPool[pool], pod); err != nil {
+					logger.Sugar().Warnf("IPPool %s is filtered by Pod: %v", pool, err)
 					errs = append(errs, err)
-					logger.Sugar().Warnf("IPPool %s is filtered by Pod %s/%s: %v", pool, pod.Namespace, pod.Name, err)
-					continue
+
+					delete(c.PToIPPool, pool)
+					c.Pools = append((c.Pools)[:j], (c.Pools)[j+1:]...)
+					j--
 				}
-				selectedPools = append(selectedPools, pool)
 			}
 
-			if len(errs) == len(c.Pools) {
+			if len(c.Pools) == 0 {
 				return fmt.Errorf("%w, all IPv%d IPPools %v of %s filtered out: %v", constant.ErrNoAvailablePool, c.IPVersion, c.Pools, t.NIC, utilerrors.NewAggregate(errs))
 			}
-			c.Pools = selectedPools
 		}
 	}
 
 	return nil
 }
 
-func (i *ipam) selectByPod(ctx context.Context, version types.IPVersion, poolName string, pod *corev1.Pod) error {
-	ipPool, err := i.ipPoolManager.GetIPPoolByName(ctx, poolName)
-	if err != nil {
-		return fmt.Errorf("failed to get IPPool %s: %v", poolName, err)
-	}
-
+func (i *ipam) selectByPod(ctx context.Context, version types.IPVersion, ipPool *spiderpoolv1.SpiderIPPool, pod *corev1.Pod) error {
 	if ipPool.DeletionTimestamp != nil {
-		return fmt.Errorf("terminating IPPool %s", poolName)
+		return fmt.Errorf("terminating IPPool %s", ipPool.Name)
 	}
 
 	if *ipPool.Spec.Disable {
-		return fmt.Errorf("disabled IPPool %s", poolName)
+		return fmt.Errorf("disabled IPPool %s", ipPool.Name)
 	}
 
 	if *ipPool.Spec.IPVersion != version {
-		return fmt.Errorf("expect an IPv%d IPPool, but the version of the IPPool %s is IPv%d", version, poolName, *ipPool.Spec.IPVersion)
+		return fmt.Errorf("expect an IPv%d IPPool, but the version of the IPPool %s is IPv%d", version, ipPool.Name, *ipPool.Spec.IPVersion)
 	}
 
 	if ipPool.Status.TotalIPCount != nil && ipPool.Status.AllocatedIPCount != nil {
@@ -879,54 +979,66 @@ func (i *ipam) selectByPod(ctx context.Context, version types.IPVersion, poolNam
 	}
 
 	if ipPool.Spec.NodeAffinity != nil {
-		nodeMatched, err := i.nodeManager.MatchLabelSelector(ctx, pod.Spec.NodeName, ipPool.Spec.NodeAffinity)
+		node, err := i.nodeManager.GetNodeByName(ctx, pod.Spec.NodeName)
 		if err != nil {
-			return fmt.Errorf("failed to check the Node affinity of IPPool %s: %v", poolName, err)
+			return err
 		}
-		if !nodeMatched {
-			return fmt.Errorf("unmatched Node affinity of IPPool %s", poolName)
+		selector, err := metav1.LabelSelectorAsSelector(ipPool.Spec.NodeAffinity)
+		if err != nil {
+			return err
+		}
+		if !selector.Matches(labels.Set(node.Labels)) {
+			return fmt.Errorf("unmatched Node affinity of IPPool %s", ipPool.Name)
 		}
 	}
 
 	if ipPool.Spec.NamespaceAffinity != nil {
-		nsMatched, err := i.nsManager.MatchLabelSelector(ctx, pod.Namespace, ipPool.Spec.NamespaceAffinity)
+		namespace, err := i.nsManager.GetNamespaceByName(ctx, pod.Namespace)
+		if err != nil {
+			return err
+		}
+		selector, err := metav1.LabelSelectorAsSelector(ipPool.Spec.NamespaceAffinity)
 		if err != nil {
-			return fmt.Errorf("failed to check the Namespace affinity of IPPool %s: %v", poolName, err)
+			return err
 		}
-		if !nsMatched {
-			return fmt.Errorf("unmatched Namespace affinity of IPPool %s", poolName)
+		if !selector.Matches(labels.Set(namespace.Labels)) {
+			return fmt.Errorf("unmatched Namespace affinity of IPPool %s", ipPool.Name)
 		}
 	}
 
 	if ipPool.Spec.PodAffinity != nil {
-		podMatched, err := i.podManager.MatchLabelSelector(ctx, pod.Namespace, pod.Name, ipPool.Spec.PodAffinity)
+		selector, err := metav1.LabelSelectorAsSelector(ipPool.Spec.PodAffinity)
 		if err != nil {
-			return fmt.Errorf("failed to check the Pod affinity of IPPool %s: %v", poolName, err)
+			return err
 		}
-		if !podMatched {
-			return fmt.Errorf("unmatched Pod affinity of IPPool %s", poolName)
+		if !selector.Matches(labels.Set(pod.Labels)) {
+			return fmt.Errorf("unmatched Pod affinity of IPPool %s", ipPool.Name)
 		}
 	}
 
 	return nil
 }
 
-// TODO(iiiceoo): Refactor
-func (i *ipam) verifyPoolCandidates(ctx context.Context, tt []*ToBeAllocated) error {
+func (i *ipam) verifyPoolCandidates(tt ToBeAllocateds) error {
 	for _, t := range tt {
-		var allPools []string
+		var allIPPools []*spiderpoolv1.SpiderIPPool
 		for _, c := range t.PoolCandidates {
-			allPools = append(allPools, c.Pools...)
+			allIPPools = append(allIPPools, c.PToIPPool.IPPools()...)
 		}
-		vlanToPools, same, err := i.ipPoolManager.CheckVlanSame(ctx, allPools)
-		if err != nil {
-			return err
+
+		vlanToPools := map[types.Vlan][]string{}
+		for _, ipPool := range allIPPools {
+			vlanToPools[*ipPool.Spec.Vlan] = append(vlanToPools[*ipPool.Spec.Vlan], ipPool.Name)
 		}
-		if !same {
-			return fmt.Errorf("%w, vlans in each IPPools are not same: %v", constant.ErrWrongInput, vlanToPools)
+
+		if len(vlanToPools) > 1 {
+			return fmt.Errorf("%w, the VLANs of the IPPools corresponding to NIC %s are not all the same: %v", constant.ErrWrongInput, t.NIC, vlanToPools)
 		}
 	}
 
+	// TODO(iiiceoo): Different NICs should not use IP address pertaining to
+	// the same subnet.
+
 	return nil
 }
 
@@ -934,111 +1046,140 @@ func (i *ipam) Release(ctx context.Context, delArgs *models.IpamDelArgs) error {
 	logger := logutils.FromContext(ctx)
 	logger.Info("Start to release")
 
-	endpoint, err := i.weManager.GetEndpointByName(ctx, *delArgs.PodNamespace, *delArgs.PodName)
-	if client.IgnoreNotFound(err) != nil {
+	endpoint, err := i.endpointManager.GetEndpointByName(ctx, *delArgs.PodNamespace, *delArgs.PodName)
+	if err != nil {
+		if apierrors.IsNotFound(err) {
+			logger.Info("Endpoin does not exist, ignoring release")
+			return nil
+		}
 		return fmt.Errorf("failed to get Endpoint %s/%s: %v", *delArgs.PodNamespace, *delArgs.PodName, err)
 	}
-	allocation, currently := workloadendpointmanager.RetrieveIPAllocation(*delArgs.ContainerID, *delArgs.IfName, true, endpoint)
-	if allocation == nil {
-		logger.Info("Nothing retrieved for releasing")
-	} else {
-		if !currently {
-			logger.Warn("Request to release non current IP allocation, concurrency may exist between the same Pod")
+
+	if err := i.releaseForAllNICs(ctx, *delArgs.ContainerID, *delArgs.IfName, endpoint); err != nil {
+		return err
+	}
+
+	if i.config.EnableSpiderSubnet && endpoint.Status.OwnerControllerType == constant.KindPod {
+		logger.Info("try to check whether need to delete dead orphan pod's auto-created IPPool")
+		err := i.deleteDeadOrphanPodAutoIPPool(ctx, *delArgs.PodNamespace, *delArgs.PodName, *delArgs.IfName)
+		if nil != err {
+			logger.Sugar().Errorf("failed to delete dead orphan pod auto-created IPPool: %v", err)
 		}
+	}
 
-		// check whether the StatefulSet pod need to release
-		// ref: https://github.com/spidernet-io/spiderpool/issues/1045
-		if i.config.EnableStatefulSet && endpoint.Status.OwnerControllerType == constant.KindStatefulSet {
-			shouldCleanSts, err := i.shouldReleaseStatefulSet(ctx, endpoint.Namespace, endpoint.Name, allocation, currently)
-			if nil != err {
-				return err
-			}
-			if !shouldCleanSts {
-				logger.Info("No need to release the IP allocation of an StatefulSet whose scale is not reduced")
-				return nil
-			}
+	return nil
+}
+
+func (i *ipam) releaseForAllNICs(ctx context.Context, containerID, nic string, endpoint *spiderpoolv1.SpiderEndpoint) error {
+	logger := logutils.FromContext(ctx)
+
+	rollback := i.getRollback(containerID)
+	if len(rollback) != 0 {
+		details := convertResultsToIPDetails(rollback)
+		logger.Sugar().Infof("Roll back IP allocation details: %+v", details)
+
+		if err := i.release(ctx, containerID, details); err != nil {
+			return fmt.Errorf("failed to roll back the allocated IP addresses: %v", err)
 		}
+		i.removeRollback(containerID)
+		logger.Info("Succeed to roll back")
+
+		return nil
+	}
 
-		if err = i.release(ctx, allocation.ContainerID, allocation.IPs); err != nil {
+	allocation := workloadendpointmanager.RetrieveIPAllocation(containerID, nic, endpoint)
+	if allocation == nil {
+		logger.Info("Nothing retrieved for releasing")
+		return nil
+	}
+
+	// Check whether an STS needs to release its currently allocated IP addresses.
+	// It is discussed in https://github.com/spidernet-io/spiderpool/issues/1045
+	if i.config.EnableStatefulSet && endpoint.Status.OwnerControllerType == constant.KindStatefulSet {
+		clean, err := i.shouldReleaseStatefulSet(ctx, endpoint.Namespace, endpoint.Name, allocation)
+		if err != nil {
 			return err
 		}
-		if err := i.weManager.ClearCurrentIPAllocation(ctx, *delArgs.ContainerID, endpoint); err != nil {
-			return fmt.Errorf("failed to clear current IP allocation: %v", err)
+		if !clean {
+			logger.Info("There is no need to release the IP allocation of StatefulSet")
+			return nil
 		}
-		logger.Sugar().Infof("Succeed to release: %+v", allocation.IPs)
 	}
 
-	// this serves for orphan pod if SpiderSubnet feature is enabled
-	if i.config.EnableSpiderSubnet {
-		logger.Info("try to check whether need to delete dead orphan pod's auto-created IPPool")
-		err = i.deleteDeadOrphanPodAutoIPPool(ctx, *delArgs.PodNamespace, *delArgs.PodName, *delArgs.IfName)
-		if nil != err {
-			return fmt.Errorf("failed to delete dead orphan pod auto-created IPPool: %v", err)
-		}
+	logger.Sugar().Infof("Release IP allocation details: %+v", allocation.IPs)
+	if err := i.release(ctx, allocation.ContainerID, allocation.IPs); err != nil {
+		return err
 	}
 
+	logger.Info("Clear the current IP allocation")
+	if err := i.endpointManager.ClearCurrentIPAllocation(ctx, containerID, endpoint); err != nil {
+		return fmt.Errorf("failed to clear current IP allocation: %v", err)
+	}
+
+	logger.Info("Succeed to release")
+
 	return nil
 }
 
 // shouldReleaseStatefulSet checks whether the StatefulSet pod need to be released, if the StatefulSet object was deleted or decreased its replicas.
 // And we'll also check whether the StatefulSet pod's last ipam allocation is invalid or not,
 // if we set dual stack but only get one IP allocation, we should clean up it.
-func (i *ipam) shouldReleaseStatefulSet(ctx context.Context, podNamespace, podName string, allocation *spiderpoolv1.PodIPAllocation, currently bool) (bool, error) {
-	log := logutils.FromContext(ctx)
+func (i *ipam) shouldReleaseStatefulSet(ctx context.Context, podNamespace, podName string, allocation *spiderpoolv1.PodIPAllocation) (bool, error) {
+	logger := logutils.FromContext(ctx)
 
 	isValidStsPod, err := i.stsManager.IsValidStatefulSetPod(ctx, podNamespace, podName, constant.KindStatefulSet)
 	if err != nil {
 		return false, err
 	}
 
-	// StatefulSet deleted or replicas decreased
+	// StatefulSet has been deleted or scaled down.
 	if !isValidStsPod {
 		return true, nil
 	}
 
-	// the last allocation is failed, try to clean up all allocation and re-allocate in the next time
-	if currently {
-		for index := range allocation.IPs {
-			if i.config.EnableIPv4 && allocation.IPs[index].IPv4 == nil ||
-				i.config.EnableIPv6 && allocation.IPs[index].IPv6 == nil {
-				log.Sugar().Warnf("StatefulSet pod has legacy failure allocation %v", allocation.IPs[index])
-				return true, nil
-			}
+	// The last allocation failed, try to clean up all allocated IP addresses
+	// and re-allocate in the next time.
+	for _, d := range allocation.IPs {
+		if i.config.EnableIPv4 && d.IPv4 == nil ||
+			i.config.EnableIPv6 && d.IPv6 == nil {
+			logger.Sugar().Warnf("The Pod of StatefulSet has legacy failure allocation %+v", d)
+			return true, nil
 		}
 	}
 
+	// When len(allocation.IPs) == 0, no cleaning is required. Of course, this
+	// situation will be handled in RetrieveIPAllocation() first.
 	return false, nil
 }
 
 func (i *ipam) release(ctx context.Context, containerID string, details []spiderpoolv1.IPAllocationDetail) error {
-	logger := logutils.FromContext(ctx)
-
 	if len(details) == 0 {
 		return nil
 	}
 
-	poolToIPAndCIDs := GroupIPDetails(containerID, details)
-	errCh := make(chan error, len(poolToIPAndCIDs))
+	logger := logutils.FromContext(ctx)
+	pics := GroupIPDetails(containerID, "", details)
+	tickets := pics.Pools()
+	if err := i.ipamLimiter.AcquireTicket(ctx, tickets...); err != nil {
+		return fmt.Errorf("failed to queue correctly: %v", err)
+	}
+	defer i.ipamLimiter.ReleaseTicket(ctx, tickets...)
+
+	errCh := make(chan error, len(pics))
 	wg := sync.WaitGroup{}
-	wg.Add(len(poolToIPAndCIDs))
+	wg.Add(len(pics))
 
-	for pool, ipAndCIDs := range poolToIPAndCIDs {
-		go func(pool string, ipAndCIDs []types.IPAndCID) {
+	for p, ics := range pics {
+		go func(poolName string, ipAndCIDs []types.IPAndCID) {
 			defer wg.Done()
 
-			_, err := i.ipamLimiter.AcquireTicket(ctx, pool)
-			if err != nil {
-				logger.Sugar().Errorf("Failed to queue correctly: %v", err)
-			} else {
-				defer i.ipamLimiter.ReleaseTicket(ctx, pool)
-			}
-
-			if err := i.ipPoolManager.ReleaseIP(ctx, pool, ipAndCIDs); err != nil {
+			if err := i.ipPoolManager.ReleaseIP(ctx, poolName, ipAndCIDs); err != nil {
+				logger.Warn(err.Error())
 				errCh <- err
 				return
 			}
-			logger.Sugar().Infof("Succeed to release IP address %+v from IPPool %s", ipAndCIDs, pool)
-		}(pool, ipAndCIDs)
+			logger.Sugar().Infof("Succeed to release IP addresses %+v from IPPool %s", ipAndCIDs, poolName)
+		}(p, ics)
 	}
 	wg.Wait()
 	close(errCh)
@@ -1049,16 +1190,12 @@ func (i *ipam) release(ctx context.Context, containerID string, details []spider
 	}
 
 	if len(errs) != 0 {
-		return fmt.Errorf("failed to release all allocated IP addresses %+v: %w", poolToIPAndCIDs, utilerrors.NewAggregate(errs))
+		return fmt.Errorf("failed to release all allocated IP addresses %+v: %w", pics, utilerrors.NewAggregate(errs))
 	}
 
 	return nil
 }
 
-func (i *ipam) Start(ctx context.Context) error {
-	return i.ipamLimiter.Start(ctx)
-}
-
 // deleteDeadOrphanPodAutoIPPool will delete orphan pod corresponding IPPools
 func (i *ipam) deleteDeadOrphanPodAutoIPPool(ctx context.Context, podNS, podName, ifName string) error {
 	log := logutils.FromContext(ctx)
@@ -1103,3 +1240,29 @@ func (i *ipam) deleteDeadOrphanPodAutoIPPool(ctx context.Context, podNS, podName
 
 	return nil
 }
+
+func (i *ipam) addRollback(containerID string, results []*AllocationResult) {
+	i.rollbacks.Store(containerID, results)
+}
+
+func (i *ipam) removeRollback(containerID string) {
+	i.rollbacks.Delete(containerID)
+}
+
+func (i *ipam) getRollback(containerID string) []*AllocationResult {
+	v, ok := i.rollbacks.Load(containerID)
+	if !ok {
+		return nil
+	}
+
+	results, ok := v.([]*AllocationResult)
+	if !ok {
+		return nil
+	}
+
+	return results
+}
+
+func (i *ipam) Start(ctx context.Context) error {
+	return i.ipamLimiter.Start(ctx)
+}
diff --git a/pkg/ipam/types.go b/pkg/ipam/types.go
index 4cfab5d28..0edba94ef 100644
--- a/pkg/ipam/types.go
+++ b/pkg/ipam/types.go
@@ -7,28 +7,85 @@ import (
 	"fmt"
 
 	"github.com/spidernet-io/spiderpool/api/v1/agent/models"
+	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
+type ToBeAllocateds []*ToBeAllocated
+
+func (tt *ToBeAllocateds) Pools() []string {
+	var pools []string
+	for _, t := range *tt {
+		pools = append(pools, t.Pools()...)
+	}
+
+	return pools
+}
+
+func (tt *ToBeAllocateds) Candidates() []*PoolCandidate {
+	var candidates []*PoolCandidate
+	for _, t := range *tt {
+		candidates = append(candidates, t.PoolCandidates...)
+	}
+
+	return candidates
+}
+
 type ToBeAllocated struct {
 	NIC            string
 	CleanGateway   bool
 	PoolCandidates []*PoolCandidate
 }
 
-type PoolCandidate struct {
-	IPVersion types.IPVersion
-	Pools     []string
+func (t *ToBeAllocated) Pools() []string {
+	var pools []string
+	for _, c := range t.PoolCandidates {
+		pools = append(pools, c.Pools...)
+	}
+
+	return pools
 }
 
 func (t *ToBeAllocated) String() string {
 	return fmt.Sprintf("%+v", *t)
 }
 
+type PoolCandidate struct {
+	IPVersion types.IPVersion
+	Pools     []string
+	PToIPPool PoolNameToIPPool
+}
+
 func (c *PoolCandidate) String() string {
 	return fmt.Sprintf("%+v", *c)
 }
 
+type PoolNameToIPPool map[string]*spiderpoolv1.SpiderIPPool
+
+func (ptp *PoolNameToIPPool) IPPools() []*spiderpoolv1.SpiderIPPool {
+	var ipPools []*spiderpoolv1.SpiderIPPool
+	for _, p := range *ptp {
+		ipPools = append(ipPools, p)
+	}
+
+	return ipPools
+}
+
+func (pp PoolNameToIPPool) String() string {
+	return ""
+}
+
+type PoolNameToIPAndCIDs map[string][]types.IPAndCID
+
+func (pics *PoolNameToIPAndCIDs) Pools() []string {
+	var pools []string
+	for pool := range *pics {
+		pools = append(pools, pool)
+	}
+
+	return pools
+}
+
 type AllocationResult struct {
 	IP           *models.IPConfig
 	Routes       []*models.Route
diff --git a/pkg/ipam/utils.go b/pkg/ipam/utils.go
index e4eda96c0..0480c9c75 100644
--- a/pkg/ipam/utils.go
+++ b/pkg/ipam/utils.go
@@ -23,7 +23,7 @@ import (
 	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
-func getPoolFromPodAnnoPools(ctx context.Context, anno, nic string) ([]*ToBeAllocated, error) {
+func getPoolFromPodAnnoPools(ctx context.Context, anno, nic string) (ToBeAllocateds, error) {
 	logger := logutils.FromContext(ctx)
 	logger.Sugar().Infof("Use IPPools from Pod annotation '%s'", constant.AnnoPodIPPools)
 
@@ -42,19 +42,17 @@ func getPoolFromPodAnnoPools(ctx context.Context, anno, nic string) ([]*ToBeAllo
 		if v.NIC == "" {
 			return nil, fmt.Errorf("%w: interface must be specified", errPrefix)
 		}
-		if len(v.IPv4Pools) == 0 && len(v.IPv6Pools) == 0 {
-			return nil, fmt.Errorf("%w: at least one pool must be specified", errPrefix)
+		if _, ok := nicSet[v.NIC]; ok {
+			return nil, fmt.Errorf("%w: duplicate interface %s", errPrefix, v.NIC)
 		}
 		nicSet[v.NIC] = struct{}{}
 	}
-	if len(nicSet) < len(annoPodIPPools) {
-		return nil, fmt.Errorf("%w: duplicate interface", errPrefix)
-	}
+
 	if _, ok := nicSet[nic]; !ok {
 		return nil, fmt.Errorf("%w: interfaces do not contain that requested by runtime", errPrefix)
 	}
 
-	var tt []*ToBeAllocated
+	var tt ToBeAllocateds
 	for _, v := range annoPodIPPools {
 		t := &ToBeAllocated{
 			NIC:          v.NIC,
@@ -83,13 +81,9 @@ func getPoolFromPodAnnoPool(ctx context.Context, anno, nic string, cleanGateway
 	logger.Sugar().Infof("Use IPPools from Pod annotation '%s'", constant.AnnoPodIPPool)
 
 	var annoPodIPPool types.AnnoPodIPPoolValue
-	errPrifix := fmt.Errorf("%w, invalid format of Pod annotation '%s'", constant.ErrWrongInput, constant.AnnoPodIPPool)
+	errPrefix := fmt.Errorf("%w, invalid format of Pod annotation '%s'", constant.ErrWrongInput, constant.AnnoPodIPPool)
 	if err := json.Unmarshal([]byte(anno), &annoPodIPPool); err != nil {
-		return nil, fmt.Errorf("%w: %v", errPrifix, err)
-	}
-
-	if len(annoPodIPPool.IPv4Pools) == 0 && len(annoPodIPPool.IPv6Pools) == 0 {
-		return nil, fmt.Errorf("%w: at least one IPPool must be specified", errPrifix)
+		return nil, fmt.Errorf("%w: %v", errPrefix, err)
 	}
 
 	t := &ToBeAllocated{
@@ -113,13 +107,13 @@ func getPoolFromPodAnnoPool(ctx context.Context, anno, nic string, cleanGateway
 }
 
 func getPoolFromNetConf(ctx context.Context, nic string, netConfV4Pool, netConfV6Pool []string, cleanGateway bool) *ToBeAllocated {
-	logger := logutils.FromContext(ctx)
-
 	if len(netConfV4Pool) == 0 && len(netConfV6Pool) == 0 {
 		return nil
 	}
 
+	logger := logutils.FromContext(ctx)
 	logger.Info("Use IPPools from CNI network configuration")
+
 	t := &ToBeAllocated{
 		NIC:          nic,
 		CleanGateway: cleanGateway,
@@ -140,7 +134,7 @@ func getPoolFromNetConf(ctx context.Context, nic string, netConfV4Pool, netConfV
 	return t
 }
 
-func getCustomRoutes(ctx context.Context, pod *corev1.Pod) ([]*models.Route, error) {
+func getCustomRoutes(pod *corev1.Pod) ([]*models.Route, error) {
 	anno, ok := pod.Annotations[constant.AnnoPodRoutes]
 	if !ok {
 		return nil, nil
@@ -162,28 +156,35 @@ func getCustomRoutes(ctx context.Context, pod *corev1.Pod) ([]*models.Route, err
 	return convertAnnoPodRoutesToOAIRoutes(annoPodRoutes), nil
 }
 
-// TODO(iiiceoo): Refactor
-func groupCustomRoutesByGW(ctx context.Context, customRoutes *[]*models.Route, ip *models.IPConfig) ([]*models.Route, error) {
-	if len(*customRoutes) == 0 {
-		return nil, nil
+func groupCustomRoutes(ctx context.Context, customRoutes []*models.Route, results []*AllocationResult) error {
+	if len(customRoutes) == 0 {
+		return nil
 	}
 
-	_, ipNet, err := net.ParseCIDR(*ip.Address)
-	if err != nil {
-		return nil, err
-	}
+	for _, res := range results {
+		_, ipNet, err := net.ParseCIDR(*res.IP.Address)
+		if err != nil {
+			return err
+		}
+
+		for i := 0; i < len(customRoutes); i++ {
+			route := customRoutes[i]
+			if ipNet.Contains(net.ParseIP(*route.Gw)) {
+				route.IfName = res.IP.Nic
+				res.Routes = append(res.Routes, route)
 
-	var routes []*models.Route
-	for i := 0; i < len(*customRoutes); i++ {
-		if ipNet.Contains(net.ParseIP(*(*customRoutes)[i].Gw)) {
-			*(*customRoutes)[i].IfName = *ip.Nic
-			routes = append(routes, (*customRoutes)[i])
-			*customRoutes = append((*customRoutes)[:i], (*customRoutes)[i+1:]...)
-			i--
+				customRoutes = append((customRoutes)[:i], (customRoutes)[i+1:]...)
+				i--
+			}
 		}
 	}
 
-	return routes, nil
+	if len(customRoutes) != 0 {
+		logger := logutils.FromContext(ctx)
+		logger.Sugar().Warnf("Invalid custom routes: %+v", customRoutes)
+	}
+
+	return nil
 }
 
 // getAutoPoolIPNumberAndSelector calculates the auto-created IPPool IP number with the given params pod and pod top controller.
@@ -198,27 +199,27 @@ func getAutoPoolIPNumberAndSelector(pod *corev1.Pod, podController types.PodTopC
 	case constant.KindPod:
 		return 1, &metav1.LabelSelector{MatchLabels: pod.Labels}, nil
 	case constant.KindDeployment:
-		deployment := podController.App.(*appsv1.Deployment)
+		deployment := podController.APP.(*appsv1.Deployment)
 		appReplicas = subnetmanagercontrollers.GetAppReplicas(deployment.Spec.Replicas)
 		podSelector = deployment.Spec.Selector
 	case constant.KindReplicaSet:
-		replicaSet := podController.App.(*appsv1.ReplicaSet)
+		replicaSet := podController.APP.(*appsv1.ReplicaSet)
 		podSelector = replicaSet.Spec.Selector
 		appReplicas = subnetmanagercontrollers.GetAppReplicas(replicaSet.Spec.Replicas)
 	case constant.KindStatefulSet:
-		statefulSet := podController.App.(*appsv1.StatefulSet)
+		statefulSet := podController.APP.(*appsv1.StatefulSet)
 		appReplicas = subnetmanagercontrollers.GetAppReplicas(statefulSet.Spec.Replicas)
 		podSelector = statefulSet.Spec.Selector
 	case constant.KindDaemonSet:
-		daemonSet := podController.App.(*appsv1.DaemonSet)
+		daemonSet := podController.APP.(*appsv1.DaemonSet)
 		appReplicas = int(daemonSet.Status.DesiredNumberScheduled)
 		podSelector = daemonSet.Spec.Selector
 	case constant.KindJob:
-		job := podController.App.(*batchv1.Job)
+		job := podController.APP.(*batchv1.Job)
 		appReplicas = subnetmanagercontrollers.CalculateJobPodNum(job.Spec.Parallelism, job.Spec.Completions)
 		podSelector = job.Spec.Selector
 	case constant.KindCronJob:
-		cronJob := podController.App.(*batchv1.CronJob)
+		cronJob := podController.APP.(*batchv1.CronJob)
 		appReplicas = subnetmanagercontrollers.CalculateJobPodNum(cronJob.Spec.JobTemplate.Spec.Parallelism, cronJob.Spec.JobTemplate.Spec.Completions)
 		podSelector = cronJob.Spec.JobTemplate.Spec.Selector
 	default:
diff --git a/pkg/ippoolmanager/config.go b/pkg/ippoolmanager/config.go
index b709d48fa..16dd1ba54 100644
--- a/pkg/ippoolmanager/config.go
+++ b/pkg/ippoolmanager/config.go
@@ -3,11 +3,23 @@
 
 package ippoolmanager
 
-import (
-	"github.com/spidernet-io/spiderpool/pkg/config"
+import "time"
+
+const (
+	defaultMaxAllocatedIPs = 5000
 )
 
 type IPPoolManagerConfig struct {
-	config.UpdateCRConfig
-	MaxAllocatedIPs int
+	MaxConflictRetries    int
+	ConflictRetryUnitTime time.Duration
+	MaxAllocatedIPs       *int
+}
+
+func setDefaultsForIPPoolManagerConfig(config IPPoolManagerConfig) IPPoolManagerConfig {
+	if config.MaxAllocatedIPs == nil {
+		maxAllocatedIPs := defaultMaxAllocatedIPs
+		config.MaxAllocatedIPs = &maxAllocatedIPs
+	}
+
+	return config
 }
diff --git a/pkg/ippoolmanager/ippool_informer.go b/pkg/ippoolmanager/ippool_informer.go
index 4cb09415c..90b93b89b 100644
--- a/pkg/ippoolmanager/ippool_informer.go
+++ b/pkg/ippoolmanager/ippool_informer.go
@@ -45,7 +45,10 @@ import (
 var informerLogger *zap.Logger
 
 type IPPoolController struct {
-	client client.Client
+	IPPoolControllerConfig
+
+	client     client.Client
+	rIPManager reservedipmanager.ReservedIPManager
 
 	poolLister    listers.SpiderIPPoolLister
 	poolSynced    cache.InformerSynced
@@ -62,8 +65,6 @@ type IPPoolController struct {
 	// v6AutoCreatedRateLimitQueue serves for IPPool informer
 	v6AutoCreatedRateLimitQueue workqueue.RateLimitingInterface
 	v6GenIPsCursor              bool
-
-	IPPoolControllerConfig
 }
 
 type IPPoolControllerConfig struct {
@@ -77,10 +78,11 @@ type IPPoolControllerConfig struct {
 	WorkQueueMaxRetries           int
 }
 
-func NewIPPoolController(client client.Client, poolControllerConfig IPPoolControllerConfig) *IPPoolController {
+func NewIPPoolController(poolControllerConfig IPPoolControllerConfig, client client.Client, rIPManager reservedipmanager.ReservedIPManager) *IPPoolController {
 	c := &IPPoolController{
-		client:                 client,
 		IPPoolControllerConfig: poolControllerConfig,
+		client:                 client,
+		rIPManager:             rIPManager,
 	}
 
 	return c
@@ -820,13 +822,8 @@ func (ic *IPPoolController) generateIPsFromSubnetWhenScaleUpIP(ctx context.Conte
 	}
 
 	// filter reserved IPs
-	var reservedIPList spiderpoolv1.SpiderReservedIPList
-	if err := ic.client.List(ctx, &reservedIPList); err != nil {
-		return nil, fmt.Errorf("failed to list reservedIPs, error: %v", err)
-	}
-
-	reservedIPs, err := reservedipmanager.AssembleReservedIPs(ipVersion, &reservedIPList)
-	if nil != err {
+	reservedIPs, err := ic.rIPManager.AssembleReservedIPs(ctx, ipVersion)
+	if err != nil {
 		return nil, fmt.Errorf("%w: failed to filter reservedIPs '%v' by IP version '%d', error: %v",
 			constant.ErrWrongInput, reservedIPs, ipVersion, err)
 	}
diff --git a/pkg/ippoolmanager/ippool_manager.go b/pkg/ippoolmanager/ippool_manager.go
index d739c66a2..360c7aa26 100644
--- a/pkg/ippoolmanager/ippool_manager.go
+++ b/pkg/ippoolmanager/ippool_manager.go
@@ -5,81 +5,56 @@ package ippoolmanager
 
 import (
 	"context"
-	"errors"
 	"fmt"
 	"math/rand"
 	"net"
-	"strings"
 	"time"
 
+	"go.uber.org/zap"
 	corev1 "k8s.io/api/core/v1"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	apitypes "k8s.io/apimachinery/pkg/types"
-	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/spidernet-io/spiderpool/api/v1/agent/models"
 	"github.com/spidernet-io/spiderpool/pkg/constant"
 	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	"github.com/spidernet-io/spiderpool/pkg/limiter"
-	"github.com/spidernet-io/spiderpool/pkg/podmanager"
+	"github.com/spidernet-io/spiderpool/pkg/logutils"
 	"github.com/spidernet-io/spiderpool/pkg/reservedipmanager"
 	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
 type IPPoolManager interface {
-	Start(ctx context.Context) error
 	GetIPPoolByName(ctx context.Context, poolName string) (*spiderpoolv1.SpiderIPPool, error)
 	ListIPPools(ctx context.Context, opts ...client.ListOption) (*spiderpoolv1.SpiderIPPoolList, error)
-	AllocateIP(ctx context.Context, poolName, containerID, nic string, pod *corev1.Pod) (*models.IPConfig, *spiderpoolv1.SpiderIPPool, error)
+	AllocateIP(ctx context.Context, poolName, containerID, nic string, pod *corev1.Pod, podController types.PodTopController) (*models.IPConfig, error)
 	ReleaseIP(ctx context.Context, poolName string, ipAndCIDs []types.IPAndCID) error
-	CheckVlanSame(ctx context.Context, poolNameList []string) (map[types.Vlan][]string, bool, error)
-	UpdateAllocatedIPs(ctx context.Context, containerID string, pod *corev1.Pod, oldIPConfig models.IPConfig) error
+	UpdateAllocatedIPs(ctx context.Context, poolName string, ipAndCIDs []types.IPAndCID) error
 	CreateIPPool(ctx context.Context, pool *spiderpoolv1.SpiderIPPool) error
 	DeleteIPPool(ctx context.Context, pool *spiderpoolv1.SpiderIPPool) error
 	UpdateDesiredIPNumber(ctx context.Context, pool *spiderpoolv1.SpiderIPPool, ipNum int) error
 }
 
 type ipPoolManager struct {
-	config         *IPPoolManagerConfig
-	freeIPsLimiter limiter.Limiter
-	client         client.Client
-	runtimeMgr     ctrl.Manager
-	podManager     podmanager.PodManager
+	config     IPPoolManagerConfig
+	client     client.Client
+	rIPManager reservedipmanager.ReservedIPManager
 }
 
-func NewIPPoolManager(c *IPPoolManagerConfig, mgr ctrl.Manager, podManager podmanager.PodManager) (IPPoolManager, error) {
-	if c == nil {
-		return nil, errors.New("ippool manager config must be specified")
+func NewIPPoolManager(config IPPoolManagerConfig, client client.Client, rIPManager reservedipmanager.ReservedIPManager) (IPPoolManager, error) {
+	if client == nil {
+		return nil, fmt.Errorf("k8s client %w", constant.ErrMissingRequiredParam)
 	}
-	if mgr == nil {
-		return nil, errors.New("k8s manager must be specified")
-	}
-	if podManager == nil {
-		return nil, errors.New("pod manager must be specified")
-	}
-
-	maxQueueSize := 1000
-	maxWaitTime := 5 * time.Second
-	freeIPsLimiter := limiter.NewLimiter(limiter.LimiterConfig{
-		MaxQueueSize: &maxQueueSize,
-		MaxWaitTime:  &maxWaitTime,
-	})
-
-	poolMgr := &ipPoolManager{
-		config:         c,
-		freeIPsLimiter: freeIPsLimiter,
-		client:         mgr.GetClient(),
-		runtimeMgr:     mgr,
-		podManager:     podManager,
+	if rIPManager == nil {
+		return nil, fmt.Errorf("reserved-IP manager %w", constant.ErrMissingRequiredParam)
 	}
 
-	return poolMgr, nil
-}
-
-func (im *ipPoolManager) Start(ctx context.Context) error {
-	return im.freeIPsLimiter.Start(ctx)
+	return &ipPoolManager{
+		config:     setDefaultsForIPPoolManagerConfig(config),
+		client:     client,
+		rIPManager: rIPManager,
+	}, nil
 }
 
 func (im *ipPoolManager) GetIPPoolByName(ctx context.Context, poolName string) (*spiderpoolv1.SpiderIPPool, error) {
@@ -100,79 +75,77 @@ func (im *ipPoolManager) ListIPPools(ctx context.Context, opts ...client.ListOpt
 	return &ipPoolList, nil
 }
 
-func (im *ipPoolManager) AllocateIP(ctx context.Context, poolName, containerID, nic string, pod *corev1.Pod) (*models.IPConfig, *spiderpoolv1.SpiderIPPool, error) {
+func (im *ipPoolManager) AllocateIP(ctx context.Context, poolName, containerID, nic string, pod *corev1.Pod, podController types.PodTopController) (*models.IPConfig, error) {
+	logger := logutils.FromContext(ctx)
+
+	r := rand.New(rand.NewSource(time.Now().UnixNano()))
 	var ipConfig *models.IPConfig
-	var usedIPPool *spiderpoolv1.SpiderIPPool
-	rand.Seed(time.Now().UnixNano())
 	for i := 0; i <= im.config.MaxConflictRetries; i++ {
+		logger := logger.With(zap.Int("times", i+1))
+		logger.Sugar().Debugf("Re-get IPPool %s for IP allocation", poolName)
+
 		ipPool, err := im.GetIPPoolByName(ctx, poolName)
 		if err != nil {
-			return nil, nil, err
+			return nil, err
 		}
 
+		logger.Debug("Generate a random IP address")
 		allocatedIP, err := im.genRandomIP(ctx, ipPool)
 		if err != nil {
-			return nil, nil, err
+			return nil, err
 		}
 
 		if ipPool.Status.AllocatedIPs == nil {
 			ipPool.Status.AllocatedIPs = spiderpoolv1.PoolIPAllocations{}
 		}
 
-		podTopController, err := im.podManager.GetPodTopController(ctx, pod)
-		if err != nil {
-			return nil, nil, err
-		}
 		allocation := spiderpoolv1.PoolIPAllocation{
 			ContainerID:         containerID,
 			NIC:                 nic,
 			Node:                pod.Spec.NodeName,
 			Namespace:           pod.Namespace,
 			Pod:                 pod.Name,
-			OwnerControllerType: podTopController.Kind,
+			OwnerControllerType: podController.Kind,
+			OwnerControllerName: podController.Name,
 		}
-		allocation.OwnerControllerName = podTopController.Name
 
-		ipPool.Status.AllocatedIPs[allocatedIP.String()] = allocation
+		ip := allocatedIP.String()
+		ipPool.Status.AllocatedIPs[ip] = allocation
 
 		if ipPool.Status.AllocatedIPCount == nil {
 			ipPool.Status.AllocatedIPCount = new(int64)
 		}
 
 		*ipPool.Status.AllocatedIPCount++
-		if *ipPool.Status.AllocatedIPCount > int64(im.config.MaxAllocatedIPs) {
-			return nil, nil, fmt.Errorf("%w, threshold of IP allocations(<=%d) for IPPool %s exceeded", constant.ErrIPUsedOut, im.config.MaxAllocatedIPs, poolName)
-		}
-
-		usedIPPool = ipPool
-		ipConfig, err = genResIPConfig(allocatedIP, &ipPool.Spec, nic, poolName)
-		if err != nil {
-			return nil, nil, err
+		if *ipPool.Status.AllocatedIPCount > int64(*im.config.MaxAllocatedIPs) {
+			return nil, fmt.Errorf("%w, threshold of IP allocations(<=%d) for IPPool %s exceeded", constant.ErrIPUsedOut, im.config.MaxAllocatedIPs, ipPool.Name)
 		}
 
+		logger.Sugar().Debugf("Try to update the allocation status of IPPool %s with random IP %s", ipPool.Name, ip)
 		if err := im.client.Status().Update(ctx, ipPool); err != nil {
 			if !apierrors.IsConflict(err) {
-				return nil, nil, err
+				return nil, err
 			}
 			if i == im.config.MaxConflictRetries {
-				return nil, nil, fmt.Errorf("%w, failed for %d times, failed to allocate IP from IPPool %s", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, poolName)
+				return nil, fmt.Errorf("%w (%d times), failed to allocate IP from IPPool %s", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, ipPool.Name)
 			}
-			time.Sleep(time.Duration(rand.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime)
+
+			interval := time.Duration(r.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime
+			logger.Sugar().Debugf("An conflict occurred when updating the status of the IPPool %s, it will be retried in %s", ipPool.Name, interval)
+
+			time.Sleep(interval)
 			continue
 		}
+
+		ipConfig = genResIPConfig(allocatedIP, nic, ipPool)
 		break
 	}
 
-	return ipConfig, usedIPPool, nil
+	return ipConfig, nil
 }
 
 func (im *ipPoolManager) genRandomIP(ctx context.Context, ipPool *spiderpoolv1.SpiderIPPool) (net.IP, error) {
-	var rIPList spiderpoolv1.SpiderReservedIPList
-	if err := im.client.List(ctx, &rIPList); err != nil {
-		return nil, err
-	}
-
-	reservedIPs, err := reservedipmanager.AssembleReservedIPs(*ipPool.Spec.IPVersion, &rIPList)
+	reservedIPs, err := im.rIPManager.AssembleReservedIPs(ctx, *ipPool.Spec.IPVersion)
 	if err != nil {
 		return nil, err
 	}
@@ -196,12 +169,17 @@ func (im *ipPoolManager) genRandomIP(ctx context.Context, ipPool *spiderpoolv1.S
 		return nil, constant.ErrIPUsedOut
 	}
 
-	return availableIPs[rand.Int()%len(availableIPs)], nil
+	return availableIPs[0], nil
 }
 
 func (im *ipPoolManager) ReleaseIP(ctx context.Context, poolName string, ipAndCIDs []types.IPAndCID) error {
-	rand.Seed(time.Now().UnixNano())
+	logger := logutils.FromContext(ctx)
+
+	r := rand.New(rand.NewSource(time.Now().UnixNano()))
 	for i := 0; i <= im.config.MaxConflictRetries; i++ {
+		logger := logger.With(zap.Int("times", i+1))
+		logger.Sugar().Debugf("Re-get IPPool %s for IP release", poolName)
+
 		ipPool, err := im.GetIPPoolByName(ctx, poolName)
 		if err != nil {
 			return err
@@ -214,29 +192,34 @@ func (im *ipPoolManager) ReleaseIP(ctx context.Context, poolName string, ipAndCI
 			ipPool.Status.AllocatedIPCount = new(int64)
 		}
 
-		needToRelease := false
-		for _, e := range ipAndCIDs {
-			if a, ok := ipPool.Status.AllocatedIPs[e.IP]; ok {
-				if a.ContainerID == e.ContainerID {
-					delete(ipPool.Status.AllocatedIPs, e.IP)
+		release := false
+		for _, cur := range ipAndCIDs {
+			if record, ok := ipPool.Status.AllocatedIPs[cur.IP]; ok {
+				if record.ContainerID == cur.ContainerID {
+					delete(ipPool.Status.AllocatedIPs, cur.IP)
 					*ipPool.Status.AllocatedIPCount--
-					needToRelease = true
+					release = true
 				}
 			}
 		}
 
-		if !needToRelease {
+		if !release {
 			return nil
 		}
 
+		logger.Sugar().Debugf("Try to clean the allocation status of IPPool %s with IP addresses %+v", ipPool.Name, ipAndCIDs)
 		if err := im.client.Status().Update(ctx, ipPool); err != nil {
 			if !apierrors.IsConflict(err) {
 				return err
 			}
 			if i == im.config.MaxConflictRetries {
-				return fmt.Errorf("%w, failed for %d times, failed to release IP %+v from IPPool %s", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, ipAndCIDs, poolName)
+				return fmt.Errorf("%w (%d times), failed to release IP addresses %+v from IPPool %s", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, ipAndCIDs, poolName)
 			}
-			time.Sleep(time.Duration(rand.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime)
+
+			interval := time.Duration(r.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime
+			logger.Sugar().Debugf("An conflict occurred when releasing form the IPPool %s, it will be retried in %s", ipPool.Name, interval)
+
+			time.Sleep(interval)
 			continue
 		}
 		break
@@ -245,66 +228,45 @@ func (im *ipPoolManager) ReleaseIP(ctx context.Context, poolName string, ipAndCI
 	return nil
 }
 
-// TODO(iiiceoo): Refactor
-func (im *ipPoolManager) CheckVlanSame(ctx context.Context, poolNameList []string) (map[types.Vlan][]string, bool, error) {
-	vlanToPools := map[types.Vlan][]string{}
-	for _, poolName := range poolNameList {
+func (im *ipPoolManager) UpdateAllocatedIPs(ctx context.Context, poolName string, ipAndCIDs []types.IPAndCID) error {
+	r := rand.New(rand.NewSource(time.Now().UnixNano()))
+	for i := 0; i <= im.config.MaxConflictRetries; i++ {
 		ipPool, err := im.GetIPPoolByName(ctx, poolName)
 		if err != nil {
-			return nil, false, err
-		}
-
-		vlanToPools[*ipPool.Spec.Vlan] = append(vlanToPools[*ipPool.Spec.Vlan], poolName)
-	}
-
-	if len(vlanToPools) > 1 {
-		return vlanToPools, false, nil
-	}
-
-	return vlanToPools, true, nil
-}
-
-// UpdateAllocatedIPs serves for StatefulSet pod re-create
-func (im *ipPoolManager) UpdateAllocatedIPs(ctx context.Context, containerID string, pod *corev1.Pod, oldIPConfig models.IPConfig) error {
-	rand.Seed(time.Now().UnixNano())
-	for i := 0; i <= im.config.MaxConflictRetries; i++ {
-		pool, err := im.GetIPPoolByName(ctx, oldIPConfig.IPPool)
-		if nil != err {
 			return err
 		}
 
-		// switch CIDR to IP
-		singleIP, _, _ := strings.Cut(*oldIPConfig.Address, "/")
-		if allocation, ok := pool.Status.AllocatedIPs[singleIP]; ok {
-			if allocation.ContainerID == containerID {
-				return nil
+		recreate := false
+		for _, cur := range ipAndCIDs {
+			if record, ok := ipPool.Status.AllocatedIPs[cur.IP]; ok {
+				if record.ContainerID == cur.ContainerID {
+					continue
+				}
+
+				record.ContainerID = cur.ContainerID
+				record.Node = cur.Node
+				recreate = true
 			}
 		}
 
-		// basically, we just need to update ContainerID and Node.
-		pool.Status.AllocatedIPs[singleIP] = spiderpoolv1.PoolIPAllocation{
-			ContainerID:         containerID,
-			NIC:                 *oldIPConfig.Nic,
-			Node:                pod.Spec.NodeName,
-			Namespace:           pod.Namespace,
-			Pod:                 pod.Name,
-			OwnerControllerType: constant.KindStatefulSet,
+		if !recreate {
+			return nil
 		}
 
-		err = im.client.Status().Update(ctx, pool)
-		if nil != err {
+		if err := im.client.Status().Update(ctx, ipPool); err != nil {
 			if !apierrors.IsConflict(err) {
 				return err
 			}
-
 			if i == im.config.MaxConflictRetries {
-				return fmt.Errorf("%w, failed for %d times, failed to re-allocate StatefulSet pod '%s/%s' SpiderIPPool IP '%s'", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, pod.Namespace, pod.Name, singleIP)
+				return fmt.Errorf("%w (%d times), failed to re-allocate the IP addresses %+v from IPPool %s", constant.ErrRetriesExhausted, im.config.MaxConflictRetries, ipAndCIDs, poolName)
 			}
 
-			time.Sleep(time.Duration(rand.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime)
+			time.Sleep(time.Duration(r.Intn(1<<(i+1))) * im.config.ConflictRetryUnitTime)
 			continue
 		}
+		break
 	}
+
 	return nil
 }
 
diff --git a/pkg/ippoolmanager/utils.go b/pkg/ippoolmanager/utils.go
index 0172ef863..5bb3b833f 100644
--- a/pkg/ippoolmanager/utils.go
+++ b/pkg/ippoolmanager/utils.go
@@ -12,27 +12,24 @@ import (
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 )
 
-func genResIPConfig(allocateIP net.IP, poolSpec *spiderpoolv1.IPPoolSpec, nic, poolName string) (*models.IPConfig, error) {
-	ipNet, err := spiderpoolip.ParseIP(*poolSpec.IPVersion, poolSpec.Subnet, true)
-	if err != nil {
-		return nil, err
-	}
+func genResIPConfig(allocateIP net.IP, nic string, ipPool *spiderpoolv1.SpiderIPPool) *models.IPConfig {
+	ipNet, _ := spiderpoolip.ParseIP(*ipPool.Spec.IPVersion, ipPool.Spec.Subnet, true)
 	ipNet.IP = allocateIP
 	address := ipNet.String()
 
 	var gateway string
-	if poolSpec.Gateway != nil {
-		gateway = *poolSpec.Gateway
+	if ipPool.Spec.Gateway != nil {
+		gateway = *ipPool.Spec.Gateway
 	}
 
 	return &models.IPConfig{
 		Address: &address,
 		Gateway: gateway,
-		IPPool:  poolName,
+		IPPool:  ipPool.Name,
 		Nic:     &nic,
-		Version: poolSpec.IPVersion,
-		Vlan:    *poolSpec.Vlan,
-	}, nil
+		Version: ipPool.Spec.IPVersion,
+		Vlan:    *ipPool.Spec.Vlan,
+	}
 }
 
 func ShouldScaleIPPool(pool *spiderpoolv1.SpiderIPPool) bool {
diff --git a/pkg/k8s/apis/spiderpool.spidernet.io/v1/spiderendpoint_types.go b/pkg/k8s/apis/spiderpool.spidernet.io/v1/spiderendpoint_types.go
index e988973f2..eef6656d1 100644
--- a/pkg/k8s/apis/spiderpool.spidernet.io/v1/spiderendpoint_types.go
+++ b/pkg/k8s/apis/spiderpool.spidernet.io/v1/spiderendpoint_types.go
@@ -15,11 +15,11 @@ type WorkloadEndpointStatus struct {
 	// +kubebuilder:validation:Optional
 	History []PodIPAllocation `json:"history,omitempty"`
 
-	// +kubebuilder:validation:Optional
-	OwnerControllerType string `json:"ownerControllerType,omitempty"`
+	// +kubebuilder:validation:Required
+	OwnerControllerType string `json:"ownerControllerType"`
 
-	// +kubebuilder:validation:Optional
-	OwnerControllerName string `json:"ownerControllerName,omitempty"`
+	// +kubebuilder:validation:Required
+	OwnerControllerName string `json:"ownerControllerName"`
 }
 
 type PodIPAllocation struct {
diff --git a/pkg/k8s/apis/spiderpool.spidernet.io/v1/types_string.go b/pkg/k8s/apis/spiderpool.spidernet.io/v1/types_string.go
index 1bf97ad80..fa832bdec 100644
--- a/pkg/k8s/apis/spiderpool.spidernet.io/v1/types_string.go
+++ b/pkg/k8s/apis/spiderpool.spidernet.io/v1/types_string.go
@@ -5,18 +5,10 @@ package v1
 
 import (
 	"fmt"
-	"reflect"
 	"strings"
-)
 
-func ValueToStringGenerated(v interface{}) string {
-	rv := reflect.ValueOf(v)
-	if rv.IsNil() {
-		return "nil"
-	}
-	pv := reflect.Indirect(rv).Interface()
-	return fmt.Sprintf("*%v", pv)
-}
+	stringutil "github.com/spidernet-io/spiderpool/pkg/utils/string"
+)
 
 // String serves for SpiderIPPool
 func (in *SpiderIPPool) String() string {
@@ -40,13 +32,13 @@ func (in *IPPoolSpec) String() string {
 	}
 
 	s := strings.Join([]string{`&IPPoolSpec{`,
-		`IPVersion:` + ValueToStringGenerated(in.IPVersion) + `,`,
+		`IPVersion:` + stringutil.ValueToStringGenerated(in.IPVersion) + `,`,
 		`Subnet:` + fmt.Sprintf("%v", in.Subnet) + `,`,
 		`IPs:` + fmt.Sprintf("%v", in.IPs) + `,`,
-		`Disable:` + ValueToStringGenerated(in.Disable) + `,`,
+		`Disable:` + stringutil.ValueToStringGenerated(in.Disable) + `,`,
 		`ExcludeIPs:` + fmt.Sprintf("%v", in.ExcludeIPs) + `,`,
-		`Gateway:` + ValueToStringGenerated(in.Gateway) + `,`,
-		`Vlan:` + ValueToStringGenerated(in.Vlan) + `,`,
+		`Gateway:` + stringutil.ValueToStringGenerated(in.Gateway) + `,`,
+		`Vlan:` + stringutil.ValueToStringGenerated(in.Vlan) + `,`,
 		`Routes:` + fmt.Sprintf("%+v", in.Routes) + `,`,
 		`PodAffinity:` + fmt.Sprintf("%v", in.PodAffinity) + `,`,
 		`NamespaceAffinity:` + fmt.Sprintf("%v", in.NamespaceAffinity) + `,`,
@@ -64,9 +56,9 @@ func (in *IPPoolStatus) String() string {
 
 	s := strings.Join([]string{`&IPPoolStatus{`,
 		`AllocatedIPs:` + fmt.Sprintf("%+v", in.AllocatedIPs) + `,`,
-		`TotalIPCount:` + ValueToStringGenerated(in.TotalIPCount) + `,`,
-		`AllocatedIPCount:` + ValueToStringGenerated(in.AllocatedIPCount) + `,`,
-		`AutoDesiredIPCount:` + ValueToStringGenerated(in.AutoDesiredIPCount) + `,`,
+		`TotalIPCount:` + stringutil.ValueToStringGenerated(in.TotalIPCount) + `,`,
+		`AllocatedIPCount:` + stringutil.ValueToStringGenerated(in.AllocatedIPCount) + `,`,
+		`AutoDesiredIPCount:` + stringutil.ValueToStringGenerated(in.AutoDesiredIPCount) + `,`,
 		`}`,
 	}, "")
 	return s
@@ -122,7 +114,7 @@ func (in *PodIPAllocation) String() string {
 
 	s := strings.Join([]string{`&PodIPAllocation{`,
 		`ContainerID:` + fmt.Sprintf("%+v", in.ContainerID) + `,`,
-		`Node:` + ValueToStringGenerated(in.Node) + `,`,
+		`Node:` + stringutil.ValueToStringGenerated(in.Node) + `,`,
 		`IPs:` + repeatedStringForIPs + `,`,
 		`CreationTime:` + fmt.Sprintf("%v", in.CreationTime) + `,`,
 		`}`,
@@ -138,14 +130,14 @@ func (in *IPAllocationDetail) String() string {
 
 	s := strings.Join([]string{`&IPAllocationDetail{`,
 		`NIC:` + fmt.Sprintf("%v", in.NIC) + `,`,
-		`IPv4:` + ValueToStringGenerated(in.IPv4) + `,`,
-		`IPv6:` + ValueToStringGenerated(in.IPv6) + `,`,
-		`IPv4Pool:` + ValueToStringGenerated(in.IPv4Pool) + `,`,
-		`IPv6Pool:` + ValueToStringGenerated(in.IPv6Pool) + `,`,
-		`Vlan:` + ValueToStringGenerated(in.Vlan) + `,`,
-		`IPv4Gateway:` + ValueToStringGenerated(in.IPv4Gateway) + `,`,
-		`IPv6Gateway:` + ValueToStringGenerated(in.IPv6Gateway) + `,`,
-		`CleanGateway:` + ValueToStringGenerated(in.CleanGateway) + `,`,
+		`IPv4:` + stringutil.ValueToStringGenerated(in.IPv4) + `,`,
+		`IPv6:` + stringutil.ValueToStringGenerated(in.IPv6) + `,`,
+		`IPv4Pool:` + stringutil.ValueToStringGenerated(in.IPv4Pool) + `,`,
+		`IPv6Pool:` + stringutil.ValueToStringGenerated(in.IPv6Pool) + `,`,
+		`Vlan:` + stringutil.ValueToStringGenerated(in.Vlan) + `,`,
+		`IPv4Gateway:` + stringutil.ValueToStringGenerated(in.IPv4Gateway) + `,`,
+		`IPv6Gateway:` + stringutil.ValueToStringGenerated(in.IPv6Gateway) + `,`,
+		`CleanGateway:` + stringutil.ValueToStringGenerated(in.CleanGateway) + `,`,
 		`Routes:` + fmt.Sprintf("%+v", in.Routes) + `,`,
 		`}`,
 	}, "")
@@ -173,7 +165,7 @@ func (in *ReservedIPSpec) String() string {
 	}
 
 	s := strings.Join([]string{`&ReservedIPSpec{`,
-		`IPVersion:` + ValueToStringGenerated(in.IPVersion) + `,`,
+		`IPVersion:` + stringutil.ValueToStringGenerated(in.IPVersion) + `,`,
 		`IPs:` + fmt.Sprintf("%v", in.IPs) + `,`,
 		`}`,
 	}, "")
@@ -202,12 +194,12 @@ func (in *SubnetSpec) String() string {
 	}
 
 	s := strings.Join([]string{`&SubnetSpec{`,
-		`IPVersion:` + ValueToStringGenerated(in.IPVersion) + `,`,
+		`IPVersion:` + stringutil.ValueToStringGenerated(in.IPVersion) + `,`,
 		`Subnet:` + fmt.Sprintf("%v", in.Subnet) + `,`,
 		`IPs:` + fmt.Sprintf("%v", in.IPs) + `,`,
 		`ExcludeIPs:` + fmt.Sprintf("%v", in.ExcludeIPs) + `,`,
-		`Gateway:` + ValueToStringGenerated(in.Gateway) + `,`,
-		`Vlan:` + ValueToStringGenerated(in.Vlan) + `,`,
+		`Gateway:` + stringutil.ValueToStringGenerated(in.Gateway) + `,`,
+		`Vlan:` + stringutil.ValueToStringGenerated(in.Vlan) + `,`,
 		`Routes:` + fmt.Sprintf("%+v", in.Routes) + `,`,
 		`}`,
 	}, "")
@@ -222,8 +214,8 @@ func (in *SubnetStatus) String() string {
 
 	s := strings.Join([]string{`SubnetStatus{`,
 		`ControlledIPPools:` + fmt.Sprintf("%v", in.ControlledIPPools) + `,`,
-		`TotalIPCount:` + ValueToStringGenerated(in.TotalIPCount) + `,`,
-		`AllocatedIPCount:` + ValueToStringGenerated(in.AllocatedIPCount) + `,`,
+		`TotalIPCount:` + stringutil.ValueToStringGenerated(in.TotalIPCount) + `,`,
+		`AllocatedIPCount:` + stringutil.ValueToStringGenerated(in.AllocatedIPCount) + `,`,
 		`}`,
 	}, "")
 	return s
diff --git a/pkg/limiter/config.go b/pkg/limiter/config.go
index d967fdd91..fc995c5bb 100644
--- a/pkg/limiter/config.go
+++ b/pkg/limiter/config.go
@@ -3,16 +3,12 @@
 
 package limiter
 
-import "time"
-
 const (
 	defaultMaxQueueSize = 1000
-	defaultMaxWaitTime  = 15 * time.Second
 )
 
 type LimiterConfig struct {
 	MaxQueueSize *int
-	MaxWaitTime  *time.Duration
 }
 
 func setDefaultsForLimiterConfig(config LimiterConfig) LimiterConfig {
@@ -21,10 +17,5 @@ func setDefaultsForLimiterConfig(config LimiterConfig) LimiterConfig {
 		config.MaxQueueSize = &maxQueueSize
 	}
 
-	if config.MaxWaitTime == nil {
-		maxWaitTime := defaultMaxWaitTime
-		config.MaxWaitTime = &maxWaitTime
-	}
-
 	return config
 }
diff --git a/pkg/limiter/queue.go b/pkg/limiter/queue.go
index 9efc13033..fb7767279 100644
--- a/pkg/limiter/queue.go
+++ b/pkg/limiter/queue.go
@@ -8,16 +8,16 @@ import (
 	"errors"
 	"fmt"
 	"sync"
-	"time"
 
 	"github.com/spidernet-io/spiderpool/pkg/lock"
 	"github.com/spidernet-io/spiderpool/pkg/logutils"
 )
 
 type Limiter interface {
-	AcquireTicket(ctx context.Context, tickets ...string) (Reason, error)
+	AcquireTicket(ctx context.Context, tickets ...string) error
 	ReleaseTicket(ctx context.Context, tickets ...string)
 	Start(ctx context.Context) error
+	Started() bool
 }
 
 func NewLimiter(c LimiterConfig) Limiter {
@@ -25,8 +25,8 @@ func NewLimiter(c LimiterConfig) Limiter {
 
 	q := &queue{
 		cond:           sync.NewCond(&lock.Mutex{}),
+		shuttingDown:   true,
 		maxQueueSize:   *c.MaxQueueSize,
-		maxWaitTime:    *c.MaxWaitTime,
 		elements:       make([]*e, 0, *c.MaxQueueSize),
 		grantedTickets: map[string]int{},
 	}
@@ -34,66 +34,45 @@ func NewLimiter(c LimiterConfig) Limiter {
 	return q
 }
 
-const DefaultTicket = "not to use this"
-
-type Reason int
-
-const (
-	Checkin Reason = iota
-	CheckinTimeout
-	UnexpectedBlocking
-	ShutdownQueue
-	FullQueue
-)
+const DefaultTicket = "not to use this ticket"
 
 var (
-	ErrUnexpectedBlocking = errors.New("unexpected blocking, forgot to start the queue or the queuer may be lost")
-	ErrShutdownQueue      = errors.New("queue has been shutdown")
-	ErrFullQueue          = errors.New("queue is full")
+	ErrStartLimiteRrepeatedly = errors.New("start the limiter repeatedly")
+	ErrShutdownQueue          = errors.New("queue shutdown")
+	ErrFullQueue              = errors.New("queue is full")
 )
 
 type queue struct {
 	cond           *sync.Cond
 	shuttingDown   bool
 	maxQueueSize   int
-	maxWaitTime    time.Duration
 	elements       []*e
 	grantedTickets map[string]int
 }
 
 type e struct {
-	wantedTickets        []string
-	notifyCheckin        chan empty
-	notifyCheckinTimeout chan empty
-	finalCheckinTime     time.Time
+	wantedTickets []string
+	notifyCheckin chan empty
 }
 
 type empty struct{}
 
-func (q *queue) AcquireTicket(ctx context.Context, tickets ...string) (Reason, error) {
+func (q *queue) AcquireTicket(ctx context.Context, tickets ...string) error {
 	logger := logutils.FromContext(ctx)
-
 	logger.Sugar().Debugf("Waiting in queue with expect tickets: %v", tickets)
+
+	// TODO(iiiceoo): When ctx times out or is canceled, AcquireTicket should
+	// not still be blocked.
+
 	e, err := q.queueUp(tickets...)
 	if err != nil {
-		if errors.Is(err, ErrShutdownQueue) {
-			return ShutdownQueue, err
-		}
-		if errors.Is(err, ErrFullQueue) {
-			return FullQueue, err
-		}
+		return err
 	}
 
-	select {
-	case <-e.notifyCheckin:
-		logger.Debug("Succeed to acquire tickets")
-		return Checkin, nil
-	case <-e.notifyCheckinTimeout:
-		logger.Debug("Succeed to acquire tickets due to timeout")
-		return CheckinTimeout, nil
-	case <-time.After(time.Until(e.finalCheckinTime.Add(3 * time.Second))):
-		return UnexpectedBlocking, ErrUnexpectedBlocking
-	}
+	<-e.notifyCheckin
+	logger.Debug("Succeed to acquire tickets")
+
+	return nil
 }
 
 func (q *queue) queueUp(tickets ...string) (*e, error) {
@@ -113,10 +92,8 @@ func (q *queue) queueUp(tickets ...string) (*e, error) {
 	}
 
 	e := &e{
-		wantedTickets:        tickets,
-		notifyCheckin:        make(chan empty),
-		notifyCheckinTimeout: make(chan empty),
-		finalCheckinTime:     time.Now().Add(q.maxWaitTime),
+		wantedTickets: tickets,
+		notifyCheckin: make(chan empty),
 	}
 	q.elements = append(q.elements, e)
 
@@ -154,15 +131,34 @@ func (q *queue) ReleaseTicket(ctx context.Context, tickets ...string) {
 }
 
 func (q *queue) Start(ctx context.Context) error {
-	defer q.gracefulShutdown()
 	logger := logutils.FromContext(ctx)
+	logger.Info("Starting limiter")
+
+	if err := q.start(); err != nil {
+		return err
+	}
+	defer q.gracefulShutdown()
 
 	go func() {
 		for !q.checkin() {
 		}
 	}()
+
 	<-ctx.Done()
-	logger.Info("Begin to shutdown the queue")
+	logger.Info("Begin to shutdown the limiter")
+
+	return nil
+}
+
+func (q *queue) start() error {
+	q.cond.L.Lock()
+	defer q.cond.L.Unlock()
+
+	if !q.shuttingDown {
+		return ErrStartLimiteRrepeatedly
+	}
+
+	q.shuttingDown = false
 
 	return nil
 }
@@ -185,45 +181,21 @@ func (q *queue) checkin() (shuttingDown bool) {
 	}
 
 	for i := 0; i < len(q.elements); i++ {
-		if time.Now().After(q.elements[i].finalCheckinTime) {
-			q.grantTicket(q.elements[i], CheckinTimeout)
-			q.elements = append(q.elements[:i], q.elements[i+1:]...)
-			i--
-			continue
-		}
-
 		if !q.checkAvailableTicket(q.elements[i].wantedTickets...) {
 			continue
 		}
 
-		q.grantTicket(q.elements[i], Checkin)
+		q.grantTicket(q.elements[i])
 		q.elements = append(q.elements[:i], q.elements[i+1:]...)
 		i--
 	}
 
-	if len(q.elements) != 0 {
-		finish := make(chan empty)
-		waitForFirstQueuer := func(e *e) {
-			select {
-			case <-time.After(time.Until(e.finalCheckinTime)):
-				q.cond.Broadcast()
-			case <-finish:
-			}
-		}
-		go waitForFirstQueuer(q.elements[0])
-
-		// Waiting here for avoiding next unnecessary round of polling q.elements
-		// following cases could make it move on:
-		// 1. A new queuer call queueUp().
-		// 2. ReleaseTicket() when ticket revert.
-		// 3. waitForFirstQueuer() found the earliest queuer who does not want
-		// waiting anymore.
-		// 4. shutdown() informs to close the queue.
-		q.cond.Wait()
-
-		// inform waitForFirstQueuer to exist if it is still running
-		close(finish)
-	}
+	// Waiting here for avoiding next unnecessary round of polling q.elements
+	// following cases could make it move on:
+	// 1. A new queuer call queueUp().
+	// 2. ReleaseTicket() when ticket revert.
+	// 3. shutdown() notify to close the queue.
+	q.cond.Wait()
 
 	return false
 }
@@ -238,16 +210,12 @@ func (q *queue) checkAvailableTicket(tickets ...string) bool {
 	return true
 }
 
-func (q *queue) grantTicket(e *e, r Reason) {
+func (q *queue) grantTicket(e *e) {
 	for _, t := range e.wantedTickets {
 		q.grantedTickets[t]++
 	}
 
-	if r == Checkin {
-		close(e.notifyCheckin)
-	} else if r == CheckinTimeout {
-		close(e.notifyCheckinTimeout)
-	}
+	close(e.notifyCheckin)
 }
 
 func (q *queue) gracefulShutdown() {
@@ -294,3 +262,10 @@ func (q *queue) waitAllTicketsRetrieved() {
 	// not be called again, and then shutdown safely.
 	q.cond.Wait()
 }
+
+func (q *queue) Started() bool {
+	q.cond.L.Lock()
+	defer q.cond.L.Unlock()
+
+	return !q.shuttingDown
+}
diff --git a/pkg/namespacemanager/namespace_manager.go b/pkg/namespacemanager/namespace_manager.go
index b17433e21..ecb854681 100644
--- a/pkg/namespacemanager/namespace_manager.go
+++ b/pkg/namespacemanager/namespace_manager.go
@@ -8,7 +8,6 @@ import (
 	"fmt"
 
 	corev1 "k8s.io/api/core/v1"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apitypes "k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
@@ -18,7 +17,6 @@ import (
 type NamespaceManager interface {
 	GetNamespaceByName(ctx context.Context, nsName string) (*corev1.Namespace, error)
 	ListNamespaces(ctx context.Context, opts ...client.ListOption) (*corev1.NamespaceList, error)
-	MatchLabelSelector(ctx context.Context, nsName string, labelSelector *metav1.LabelSelector) (bool, error)
 }
 
 type namespaceManager struct {
@@ -52,25 +50,3 @@ func (nm *namespaceManager) ListNamespaces(ctx context.Context, opts ...client.L
 
 	return &nsList, nil
 }
-
-func (nm *namespaceManager) MatchLabelSelector(ctx context.Context, nsName string, labelSelector *metav1.LabelSelector) (bool, error) {
-	selector, err := metav1.LabelSelectorAsSelector(labelSelector)
-	if err != nil {
-		return false, err
-	}
-
-	nsList, err := nm.ListNamespaces(
-		ctx,
-		client.MatchingLabelsSelector{Selector: selector},
-		client.MatchingFields{metav1.ObjectNameField: nsName},
-	)
-	if err != nil {
-		return false, err
-	}
-
-	if len(nsList.Items) == 0 {
-		return false, nil
-	}
-
-	return true, nil
-}
diff --git a/pkg/nodemanager/node_manager.go b/pkg/nodemanager/node_manager.go
index cd1f204a9..c16338de7 100644
--- a/pkg/nodemanager/node_manager.go
+++ b/pkg/nodemanager/node_manager.go
@@ -8,7 +8,6 @@ import (
 	"fmt"
 
 	corev1 "k8s.io/api/core/v1"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apitypes "k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
@@ -18,7 +17,6 @@ import (
 type NodeManager interface {
 	GetNodeByName(ctx context.Context, nodeName string) (*corev1.Node, error)
 	ListNodes(ctx context.Context, opts ...client.ListOption) (*corev1.NodeList, error)
-	MatchLabelSelector(ctx context.Context, nodeName string, labelSelector *metav1.LabelSelector) (bool, error)
 }
 
 type nodeManager struct {
@@ -52,25 +50,3 @@ func (nm *nodeManager) ListNodes(ctx context.Context, opts ...client.ListOption)
 
 	return &nodeList, nil
 }
-
-func (nm *nodeManager) MatchLabelSelector(ctx context.Context, nodeName string, labelSelector *metav1.LabelSelector) (bool, error) {
-	selector, err := metav1.LabelSelectorAsSelector(labelSelector)
-	if err != nil {
-		return false, err
-	}
-
-	nodeList, err := nm.ListNodes(
-		ctx,
-		client.MatchingLabelsSelector{Selector: selector},
-		client.MatchingFields{metav1.ObjectNameField: nodeName},
-	)
-	if err != nil {
-		return false, err
-	}
-
-	if len(nodeList.Items) == 0 {
-		return false, nil
-	}
-
-	return true, nil
-}
diff --git a/pkg/podmanager/mock/pod_manager_mock.go b/pkg/podmanager/mock/pod_manager_mock.go
deleted file mode 100644
index ec361bc3c..000000000
--- a/pkg/podmanager/mock/pod_manager_mock.go
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-// Code generated by MockGen. DO NOT EDIT.
-// Source: pod_manager.go
-
-// Package mock_podmanager is a generated GoMock package.
-package mock_podmanager
-
-import (
-	context "context"
-	reflect "reflect"
-
-	gomock "github.com/golang/mock/gomock"
-	types "github.com/spidernet-io/spiderpool/pkg/types"
-	v1 "k8s.io/api/core/v1"
-	v10 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	client "sigs.k8s.io/controller-runtime/pkg/client"
-)
-
-// MockPodManager is a mock of PodManager interface.
-type MockPodManager struct {
-	ctrl     *gomock.Controller
-	recorder *MockPodManagerMockRecorder
-}
-
-// MockPodManagerMockRecorder is the mock recorder for MockPodManager.
-type MockPodManagerMockRecorder struct {
-	mock *MockPodManager
-}
-
-// NewMockPodManager creates a new mock instance.
-func NewMockPodManager(ctrl *gomock.Controller) *MockPodManager {
-	mock := &MockPodManager{ctrl: ctrl}
-	mock.recorder = &MockPodManagerMockRecorder{mock}
-	return mock
-}
-
-// EXPECT returns an object that allows the caller to indicate expected use.
-func (m *MockPodManager) EXPECT() *MockPodManagerMockRecorder {
-	return m.recorder
-}
-
-// GetPodByName mocks base method.
-func (m *MockPodManager) GetPodByName(ctx context.Context, namespace, podName string) (*v1.Pod, error) {
-	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "GetPodByName", ctx, namespace, podName)
-	ret0, _ := ret[0].(*v1.Pod)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-// GetPodByName indicates an expected call of GetPodByName.
-func (mr *MockPodManagerMockRecorder) GetPodByName(ctx, namespace, podName interface{}) *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodByName", reflect.TypeOf((*MockPodManager)(nil).GetPodByName), ctx, namespace, podName)
-}
-
-// GetPodTopController mocks base method.
-func (m *MockPodManager) GetPodTopController(ctx context.Context, pod *v1.Pod) (types.PodTopController, error) {
-	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "GetPodTopController", ctx, pod)
-	ret0, _ := ret[0].(types.PodTopController)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-// GetPodTopController indicates an expected call of GetPodTopController.
-func (mr *MockPodManagerMockRecorder) GetPodTopController(ctx, pod interface{}) *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPodTopController", reflect.TypeOf((*MockPodManager)(nil).GetPodTopController), ctx, pod)
-}
-
-// ListPods mocks base method.
-func (m *MockPodManager) ListPods(ctx context.Context, opts ...client.ListOption) (*v1.PodList, error) {
-	m.ctrl.T.Helper()
-	varargs := []interface{}{ctx}
-	for _, a := range opts {
-		varargs = append(varargs, a)
-	}
-	ret := m.ctrl.Call(m, "ListPods", varargs...)
-	ret0, _ := ret[0].(*v1.PodList)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-// ListPods indicates an expected call of ListPods.
-func (mr *MockPodManagerMockRecorder) ListPods(ctx interface{}, opts ...interface{}) *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	varargs := append([]interface{}{ctx}, opts...)
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPods", reflect.TypeOf((*MockPodManager)(nil).ListPods), varargs...)
-}
-
-// MatchLabelSelector mocks base method.
-func (m *MockPodManager) MatchLabelSelector(ctx context.Context, namespace, podName string, labelSelector *v10.LabelSelector) (bool, error) {
-	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "MatchLabelSelector", ctx, namespace, podName, labelSelector)
-	ret0, _ := ret[0].(bool)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-// MatchLabelSelector indicates an expected call of MatchLabelSelector.
-func (mr *MockPodManagerMockRecorder) MatchLabelSelector(ctx, namespace, podName, labelSelector interface{}) *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchLabelSelector", reflect.TypeOf((*MockPodManager)(nil).MatchLabelSelector), ctx, namespace, podName, labelSelector)
-}
-
-// MergeAnnotations mocks base method.
-func (m *MockPodManager) MergeAnnotations(ctx context.Context, namespace, podName string, annotations map[string]string) error {
-	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "MergeAnnotations", ctx, namespace, podName, annotations)
-	ret0, _ := ret[0].(error)
-	return ret0
-}
-
-// MergeAnnotations indicates an expected call of MergeAnnotations.
-func (mr *MockPodManagerMockRecorder) MergeAnnotations(ctx, namespace, podName, annotations interface{}) *gomock.Call {
-	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MergeAnnotations", reflect.TypeOf((*MockPodManager)(nil).MergeAnnotations), ctx, namespace, podName, annotations)
-}
diff --git a/pkg/podmanager/pod_manager.go b/pkg/podmanager/pod_manager.go
index 57933978a..6ef9d1e5d 100644
--- a/pkg/podmanager/pod_manager.go
+++ b/pkg/podmanager/pod_manager.go
@@ -6,13 +6,10 @@ package podmanager
 import (
 	"context"
 	"fmt"
-	"math/rand"
-	"time"
 
 	appsv1 "k8s.io/api/apps/v1"
 	batchv1 "k8s.io/api/batch/v1"
 	corev1 "k8s.io/api/core/v1"
-	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apitypes "k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/client"
@@ -25,8 +22,6 @@ import (
 type PodManager interface {
 	GetPodByName(ctx context.Context, namespace, podName string) (*corev1.Pod, error)
 	ListPods(ctx context.Context, opts ...client.ListOption) (*corev1.PodList, error)
-	MatchLabelSelector(ctx context.Context, namespace, podName string, labelSelector *metav1.LabelSelector) (bool, error)
-	MergeAnnotations(ctx context.Context, namespace, podName string, annotations map[string]string) error
 	GetPodTopController(ctx context.Context, pod *corev1.Pod) (types.PodTopController, error)
 }
 
@@ -64,64 +59,6 @@ func (pm *podManager) ListPods(ctx context.Context, opts ...client.ListOption) (
 	return &podList, nil
 }
 
-func (pm *podManager) MatchLabelSelector(ctx context.Context, namespace, podName string, labelSelector *metav1.LabelSelector) (bool, error) {
-	selector, err := metav1.LabelSelectorAsSelector(labelSelector)
-	if err != nil {
-		return false, err
-	}
-
-	podList, err := pm.ListPods(
-		ctx,
-		client.InNamespace(namespace),
-		client.MatchingLabelsSelector{Selector: selector},
-		client.MatchingFields{metav1.ObjectNameField: podName},
-	)
-	if err != nil {
-		return false, err
-	}
-
-	if len(podList.Items) == 0 {
-		return false, nil
-	}
-
-	return true, nil
-}
-
-func (pm *podManager) MergeAnnotations(ctx context.Context, namespace, podName string, annotations map[string]string) error {
-	rand.Seed(time.Now().UnixNano())
-	for i := 0; i <= pm.config.MaxConflictRetries; i++ {
-		pod, err := pm.GetPodByName(ctx, namespace, podName)
-		if err != nil {
-			return err
-		}
-
-		if len(annotations) == 0 {
-			return nil
-		}
-
-		if pod.Annotations == nil {
-			pod.Annotations = map[string]string{}
-		}
-
-		for k, v := range annotations {
-			pod.Annotations[k] = v
-		}
-		if err := pm.client.Update(ctx, pod); err != nil {
-			if !apierrors.IsConflict(err) {
-				return err
-			}
-			if i == pm.config.MaxConflictRetries {
-				return fmt.Errorf("%w (%d times), failed to merge Pod annotations", constant.ErrRetriesExhausted, pm.config.MaxConflictRetries)
-			}
-			time.Sleep(time.Duration(rand.Intn(1<<(i+1))) * pm.config.ConflictRetryUnitTime)
-			continue
-		}
-		break
-	}
-
-	return nil
-}
-
 // GetPodTopController will find the pod top owner controller with the given pod.
 // For example, once we create a deployment then it will create replicaset and the replicaset will create pods.
 // So, the pods' top owner is deployment. That's what the method implements.
@@ -137,8 +74,8 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 			Kind:      constant.KindPod,
 			Namespace: pod.Namespace,
 			Name:      pod.Name,
-			Uid:       pod.UID,
-			App:       pod,
+			UID:       pod.UID,
+			APP:       pod,
 		}, nil
 	}
 
@@ -148,7 +85,7 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 			Kind:      constant.KindUnknown,
 			Namespace: pod.Namespace,
 			Name:      podOwner.Name,
-			Uid:       podOwner.UID,
+			UID:       podOwner.UID,
 		}, nil
 	}
 
@@ -177,8 +114,8 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 					Kind:      constant.KindDeployment,
 					Namespace: deployment.Namespace,
 					Name:      deployment.Name,
-					Uid:       deployment.UID,
-					App:       &deployment,
+					UID:       deployment.UID,
+					APP:       &deployment,
 				}, nil
 			}
 
@@ -187,15 +124,15 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 				Kind:      constant.KindUnknown,
 				Namespace: pod.Namespace,
 				Name:      replicasetOwner.Name,
-				Uid:       replicasetOwner.UID,
+				UID:       replicasetOwner.UID,
 			}, nil
 		}
 		return types.PodTopController{
 			Kind:      constant.KindReplicaSet,
 			Namespace: replicaset.Namespace,
 			Name:      replicaset.Name,
-			Uid:       replicaset.UID,
-			App:       &replicaset,
+			UID:       replicaset.UID,
+			APP:       &replicaset,
 		}, nil
 
 	case constant.KindJob:
@@ -216,8 +153,8 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 					Kind:      constant.KindCronJob,
 					Namespace: cronJob.Namespace,
 					Name:      cronJob.Name,
-					Uid:       cronJob.UID,
-					App:       &cronJob,
+					UID:       cronJob.UID,
+					APP:       &cronJob,
 				}, nil
 			}
 
@@ -226,15 +163,15 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 				Kind:      constant.KindUnknown,
 				Namespace: job.Namespace,
 				Name:      jobOwner.Name,
-				Uid:       jobOwner.UID,
+				UID:       jobOwner.UID,
 			}, nil
 		}
 		return types.PodTopController{
 			Kind:      constant.KindJob,
 			Namespace: job.Namespace,
 			Name:      job.Name,
-			Uid:       job.UID,
-			App:       &job,
+			UID:       job.UID,
+			APP:       &job,
 		}, nil
 
 	case constant.KindDaemonSet:
@@ -247,8 +184,8 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 			Kind:      constant.KindDaemonSet,
 			Namespace: daemonSet.Namespace,
 			Name:      daemonSet.Name,
-			Uid:       daemonSet.UID,
-			App:       &daemonSet,
+			UID:       daemonSet.UID,
+			APP:       &daemonSet,
 		}, nil
 
 	case constant.KindStatefulSet:
@@ -261,8 +198,8 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 			Kind:      constant.KindStatefulSet,
 			Namespace: statefulSet.Namespace,
 			Name:      statefulSet.Name,
-			Uid:       statefulSet.UID,
-			App:       &statefulSet,
+			UID:       statefulSet.UID,
+			APP:       &statefulSet,
 		}, nil
 	}
 
@@ -271,6 +208,6 @@ func (pm *podManager) GetPodTopController(ctx context.Context, pod *corev1.Pod)
 		Kind:      constant.KindUnknown,
 		Namespace: pod.Namespace,
 		Name:      podOwner.Name,
-		Uid:       podOwner.UID,
+		UID:       podOwner.UID,
 	}, nil
 }
diff --git a/pkg/reservedipmanager/reservedip_manager.go b/pkg/reservedipmanager/reservedip_manager.go
index 632460027..3fdb33fdf 100644
--- a/pkg/reservedipmanager/reservedip_manager.go
+++ b/pkg/reservedipmanager/reservedip_manager.go
@@ -6,17 +6,22 @@ package reservedipmanager
 import (
 	"context"
 	"fmt"
+	"net"
+	"strconv"
 
 	apitypes "k8s.io/apimachinery/pkg/types"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/spidernet-io/spiderpool/pkg/constant"
+	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
+	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
 type ReservedIPManager interface {
 	GetReservedIPByName(ctx context.Context, rIPName string) (*spiderpoolv1.SpiderReservedIP, error)
 	ListReservedIPs(ctx context.Context, opts ...client.ListOption) (*spiderpoolv1.SpiderReservedIPList, error)
+	AssembleReservedIPs(ctx context.Context, version types.IPVersion) ([]net.IP, error)
 }
 
 type reservedIPManager struct {
@@ -50,3 +55,28 @@ func (rm *reservedIPManager) ListReservedIPs(ctx context.Context, opts ...client
 
 	return &rIPList, nil
 }
+
+func (rm *reservedIPManager) AssembleReservedIPs(ctx context.Context, version types.IPVersion) ([]net.IP, error) {
+	if err := spiderpoolip.IsIPVersion(version); err != nil {
+		return nil, err
+	}
+
+	rIPList, err := rm.ListReservedIPs(ctx, client.MatchingFields{"spec.ipVersion": strconv.FormatInt(version, 10)})
+	if err != nil {
+		return nil, err
+	}
+
+	var ranges []string
+	for _, r := range rIPList.Items {
+		if r.DeletionTimestamp == nil {
+			ranges = append(ranges, r.Spec.IPs...)
+		}
+	}
+
+	ips, err := spiderpoolip.ParseIPRanges(version, ranges)
+	if err != nil {
+		return nil, err
+	}
+
+	return ips, nil
+}
diff --git a/pkg/reservedipmanager/utils.go b/pkg/reservedipmanager/utils.go
deleted file mode 100644
index 1dfaaeeba..000000000
--- a/pkg/reservedipmanager/utils.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package reservedipmanager
-
-import (
-	"fmt"
-	"net"
-
-	"github.com/spidernet-io/spiderpool/pkg/constant"
-	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
-	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	"github.com/spidernet-io/spiderpool/pkg/types"
-)
-
-func AssembleReservedIPs(version types.IPVersion, rIPList *spiderpoolv1.SpiderReservedIPList) ([]net.IP, error) {
-	if err := spiderpoolip.IsIPVersion(version); err != nil {
-		return nil, err
-	}
-
-	if rIPList == nil {
-		return nil, fmt.Errorf("reserved IP list %w", constant.ErrMissingRequiredParam)
-	}
-
-	var ips []net.IP
-	for _, r := range rIPList.Items {
-		if r.DeletionTimestamp == nil && *r.Spec.IPVersion == version {
-			rIPs, err := spiderpoolip.ParseIPRanges(version, r.Spec.IPs)
-			if err != nil {
-				return nil, err
-			}
-			ips = append(ips, rIPs...)
-		}
-	}
-
-	return ips, nil
-}
diff --git a/pkg/statefulsetmanager/sts_manager.go b/pkg/statefulsetmanager/sts_manager.go
index 524e36354..bfca3a444 100644
--- a/pkg/statefulsetmanager/sts_manager.go
+++ b/pkg/statefulsetmanager/sts_manager.go
@@ -70,7 +70,7 @@ func (sm *statefulSetManager) IsValidStatefulSetPod(ctx context.Context, namespa
 		return false, client.IgnoreNotFound(err)
 	}
 
-	// Pod controlled by StatefulSet is created or recreated.
+	// The Pod controlled by StatefulSet is created or re-created.
 	if replicas <= int(*sts.Spec.Replicas)-1 {
 		return true, nil
 	}
diff --git a/pkg/subnetmanager/app_controller.go b/pkg/subnetmanager/app_controller.go
index 1a0131229..955569e7f 100644
--- a/pkg/subnetmanager/app_controller.go
+++ b/pkg/subnetmanager/app_controller.go
@@ -688,8 +688,8 @@ func (sac *SubnetAppController) syncHandler(appKey appWorkQueueKey, log *zap.Log
 			Kind:      appKey.AppKind,
 			Namespace: app.GetNamespace(),
 			Name:      app.GetName(),
-			Uid:       app.GetUID(),
-			App:       app,
+			UID:       app.GetUID(),
+			APP:       app,
 		},
 		podSelector,
 		appReplicas)
@@ -748,7 +748,7 @@ func (sac *SubnetAppController) createOrMarkIPPool(ctx context.Context, podSubne
 
 				var v4PoolList spiderpoolv1.SpiderIPPoolList
 				errV4 = sac.client.List(ctx, &v4PoolList, client.MatchingLabels{
-					constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+					constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 					constant.LabelIPPoolOwnerSpiderSubnet:   item.IPv4[0],
 					constant.LabelIPPoolOwnerApplication:    controllers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
 					constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV4,
@@ -769,7 +769,7 @@ func (sac *SubnetAppController) createOrMarkIPPool(ctx context.Context, podSubne
 
 				var v6PoolList spiderpoolv1.SpiderIPPoolList
 				errV6 = sac.client.List(ctx, &v6PoolList, client.MatchingLabels{
-					constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+					constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 					constant.LabelIPPoolOwnerSpiderSubnet:   item.IPv6[0],
 					constant.LabelIPPoolOwnerApplication:    controllers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
 					constant.LabelIPPoolVersion:             constant.LabelIPPoolVersionV6,
diff --git a/pkg/subnetmanager/config.go b/pkg/subnetmanager/config.go
index a4d1ca887..6263cbcdf 100644
--- a/pkg/subnetmanager/config.go
+++ b/pkg/subnetmanager/config.go
@@ -4,9 +4,14 @@
 package subnetmanager
 
 import (
-	"github.com/spidernet-io/spiderpool/pkg/config"
+	"time"
 )
 
 type SubnetManagerConfig struct {
-	config.UpdateCRConfig
+	MaxConflictRetries    int
+	ConflictRetryUnitTime time.Duration
+}
+
+func setDefaultsForSubnetManagerConfig(config SubnetManagerConfig) SubnetManagerConfig {
+	return config
 }
diff --git a/pkg/subnetmanager/subnet_manager.go b/pkg/subnetmanager/subnet_manager.go
index 0750eb0e3..0c8e4fcc2 100644
--- a/pkg/subnetmanager/subnet_manager.go
+++ b/pkg/subnetmanager/subnet_manager.go
@@ -5,20 +5,17 @@ package subnetmanager
 
 import (
 	"context"
-	"errors"
 	"fmt"
 
 	"go.uber.org/zap"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apitypes "k8s.io/apimachinery/pkg/types"
-	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/spidernet-io/spiderpool/pkg/constant"
 	"github.com/spidernet-io/spiderpool/pkg/ippoolmanager"
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"github.com/spidernet-io/spiderpool/pkg/reservedipmanager"
 	"github.com/spidernet-io/spiderpool/pkg/subnetmanager/controllers"
 	"github.com/spidernet-io/spiderpool/pkg/types"
 )
@@ -33,35 +30,25 @@ type SubnetManager interface {
 var logger *zap.Logger
 
 type subnetManager struct {
-	config        *SubnetManagerConfig
+	config        SubnetManagerConfig
 	client        client.Client
-	runtimeMgr    ctrl.Manager
 	ipPoolManager ippoolmanager.IPPoolManager
-	reservedMgr   reservedipmanager.ReservedIPManager
 }
 
-func NewSubnetManager(c *SubnetManagerConfig, mgr ctrl.Manager, ipPoolManager ippoolmanager.IPPoolManager, reservedIPMgr reservedipmanager.ReservedIPManager) (SubnetManager, error) {
-	if c == nil {
-		return nil, errors.New("subnet manager config must be specified")
-	}
-	if mgr == nil {
-		return nil, errors.New("k8s manager must be specified")
+func NewSubnetManager(config SubnetManagerConfig, client client.Client, ipPoolManager ippoolmanager.IPPoolManager) (SubnetManager, error) {
+	if client == nil {
+		return nil, fmt.Errorf("k8s client %w", constant.ErrMissingRequiredParam)
 	}
 	if ipPoolManager == nil {
-		return nil, errors.New("ippool manager must be specified")
-	}
-	if reservedIPMgr == nil {
-		return nil, errors.New("reserved IP manager must be specified")
+		return nil, fmt.Errorf("ippool manager %w", constant.ErrMissingRequiredParam)
 	}
 
 	logger = logutils.Logger.Named("Subnet-Manager")
 
 	return &subnetManager{
-		config:        c,
-		client:        mgr.GetClient(),
-		runtimeMgr:    mgr,
+		config:        setDefaultsForSubnetManagerConfig(config),
+		client:        client,
 		ipPoolManager: ipPoolManager,
-		reservedMgr:   reservedIPMgr,
 	}, nil
 }
 
@@ -106,7 +93,7 @@ func (sm *subnetManager) AllocateEmptyIPPool(ctx context.Context, subnetName str
 	poolLabels := map[string]string{
 		constant.LabelIPPoolOwnerSpiderSubnet:   subnet.Name,
 		constant.LabelIPPoolOwnerApplication:    controllers.AppLabelValue(podController.Kind, podController.Namespace, podController.Name),
-		constant.LabelIPPoolOwnerApplicationUID: string(podController.Uid),
+		constant.LabelIPPoolOwnerApplicationUID: string(podController.UID),
 		constant.LabelIPPoolInterface:           ifName,
 	}
 
@@ -122,7 +109,7 @@ func (sm *subnetManager) AllocateEmptyIPPool(ctx context.Context, subnetName str
 
 	sp := &spiderpoolv1.SpiderIPPool{
 		ObjectMeta: metav1.ObjectMeta{
-			Name:   controllers.SubnetPoolName(podController.Kind, podController.Namespace, podController.Name, ipVersion, ifName, podController.Uid),
+			Name:   controllers.SubnetPoolName(podController.Kind, podController.Namespace, podController.Name, ipVersion, ifName, podController.UID),
 			Labels: poolLabels,
 		},
 		Spec: spiderpoolv1.IPPoolSpec{
diff --git a/pkg/types/ip.go b/pkg/types/ip.go
index 459806e59..669bb98b2 100644
--- a/pkg/types/ip.go
+++ b/pkg/types/ip.go
@@ -10,4 +10,5 @@ type Vlan = int64
 type IPAndCID struct {
 	IP          string
 	ContainerID string
+	Node        string
 }
diff --git a/pkg/types/k8s.go b/pkg/types/k8s.go
index 40c1629d1..d7fc0dd7b 100644
--- a/pkg/types/k8s.go
+++ b/pkg/types/k8s.go
@@ -4,12 +4,25 @@
 package types
 
 import (
+	"fmt"
+	"strings"
+
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apitypes "k8s.io/apimachinery/pkg/types"
+
+	stringutil "github.com/spidernet-io/spiderpool/pkg/utils/string"
 )
 
 type PodStatus string
 
+type PodTopController struct {
+	Kind      string
+	Namespace string
+	Name      string
+	UID       apitypes.UID
+	APP       metav1.Object
+}
+
 type AnnoPodIPPoolValue struct {
 	IPv4Pools []string `json:"ipv4,omitempty"`
 	IPv6Pools []string `json:"ipv6,omitempty"`
@@ -31,15 +44,6 @@ type AnnoRouteItem struct {
 	Gw  string `json:"gw"`
 }
 
-type AnnoPodAssignedEthxValue struct {
-	NIC      string `json:"interface"`
-	IPv4Pool string `json:"ipv4pool"`
-	IPv6Pool string `json:"ipv6pool"`
-	IPv4     string `json:"ipv4"`
-	IPv6     string `json:"ipv6"`
-	Vlan     int64  `json:"vlan"`
-}
-
 type AnnoNSDefautlV4PoolValue []string
 
 type AnnoNSDefautlV6PoolValue []string
@@ -60,6 +64,22 @@ type PodSubnetAnnoConfig struct {
 	ReclaimIPPool   bool
 }
 
+func (in *PodSubnetAnnoConfig) String() string {
+	if in == nil {
+		return "nil"
+	}
+
+	s := strings.Join([]string{`&PodSubnetAnnoConfig{`,
+		`MultipleSubnets` + fmt.Sprintf("%v", in.MultipleSubnets),
+		`SingleSubnet:` + strings.Replace(strings.Replace(in.SingleSubnet.String(), "AnnoSubnetItem", "", 1), `&`, ``, 1) + `,`,
+		`FlexibleIPNum:` + stringutil.ValueToStringGenerated(in.FlexibleIPNum) + `,`,
+		`AssignIPNumber:` + fmt.Sprintf("%v", in.AssignIPNum) + `,`,
+		`ReclaimIPPool:` + fmt.Sprintf("%v", in.ReclaimIPPool),
+		`}`,
+	}, "")
+	return s
+}
+
 // AnnoSubnetItem describes the SpiderSubnet CR names and NIC
 type AnnoSubnetItem struct {
 	Interface string   `json:"interface,omitempty"`
@@ -67,10 +87,16 @@ type AnnoSubnetItem struct {
 	IPv6      []string `json:"ipv6,omitempty"`
 }
 
-type PodTopController struct {
-	Kind      string
-	Namespace string
-	Name      string
-	Uid       apitypes.UID
-	App       metav1.Object
+func (in *AnnoSubnetItem) String() string {
+	if in == nil {
+		return "nil"
+	}
+
+	s := strings.Join([]string{`&AnnoSubnetItem{`,
+		`Interface:` + fmt.Sprintf("%v", in.Interface) + `,`,
+		`IPv4:` + fmt.Sprintf("%v", in.IPv4) + `,`,
+		`IPv6:` + fmt.Sprintf("%v", in.IPv6),
+		`}`,
+	}, "")
+	return s
 }
diff --git a/pkg/types/types_string.go b/pkg/types/types_string.go
deleted file mode 100644
index cc2265805..000000000
--- a/pkg/types/types_string.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package types
-
-import (
-	"fmt"
-	"reflect"
-	"strings"
-)
-
-func valueToStringGenerated(v interface{}) string {
-	rv := reflect.ValueOf(v)
-	if rv.IsNil() {
-		return "nil"
-	}
-	pv := reflect.Indirect(rv).Interface()
-	return fmt.Sprintf("*%v", pv)
-}
-
-func (in *PodSubnetAnnoConfig) String() string {
-	if in == nil {
-		return "nil"
-	}
-
-	s := strings.Join([]string{`&PodSubnetAnnoConfig{`,
-		`MultipleSubnets` + fmt.Sprintf("%v", in.MultipleSubnets),
-		`SingleSubnet:` + strings.Replace(strings.Replace(in.SingleSubnet.String(), "AnnoSubnetItem", "", 1), `&`, ``, 1) + `,`,
-		`FlexibleIPNum:` + valueToStringGenerated(in.FlexibleIPNum) + `,`,
-		`AssignIPNumber:` + fmt.Sprintf("%v", in.AssignIPNum) + `,`,
-		`ReclaimIPPool:` + fmt.Sprintf("%v", in.ReclaimIPPool),
-		`}`,
-	}, "")
-	return s
-}
-
-func (in *AnnoSubnetItem) String() string {
-	if in == nil {
-		return "nil"
-	}
-
-	s := strings.Join([]string{`&AnnoSubnetItem{`,
-		`Interface:` + fmt.Sprintf("%v", in.Interface) + `,`,
-		`IPv4:` + fmt.Sprintf("%v", in.IPv4) + `,`,
-		`IPv6:` + fmt.Sprintf("%v", in.IPv6),
-		`}`,
-	}, "")
-	return s
-}
diff --git a/pkg/utils/string/string.go b/pkg/utils/string/string.go
new file mode 100644
index 000000000..4ee5240df
--- /dev/null
+++ b/pkg/utils/string/string.go
@@ -0,0 +1,18 @@
+// Copyright 2022 Authors of spidernet-io
+// SPDX-License-Identifier: Apache-2.0
+
+package string
+
+import (
+	"fmt"
+	"reflect"
+)
+
+func ValueToStringGenerated(v interface{}) string {
+	rv := reflect.ValueOf(v)
+	if rv.IsNil() {
+		return "nil"
+	}
+	pv := reflect.Indirect(rv).Interface()
+	return fmt.Sprintf("*%v", pv)
+}
diff --git a/pkg/workloadendpointmanager/utils.go b/pkg/workloadendpointmanager/utils.go
index eff8c6205..9e9c5e07d 100644
--- a/pkg/workloadendpointmanager/utils.go
+++ b/pkg/workloadendpointmanager/utils.go
@@ -11,37 +11,23 @@ import (
 	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
-func RetrieveIPAllocation(containerID, nic string, includeHistory bool, endpoint *spiderpoolv1.SpiderEndpoint) (allocation *spiderpoolv1.PodIPAllocation, currently bool) {
+func RetrieveIPAllocation(containerID, nic string, endpoint *spiderpoolv1.SpiderEndpoint) *spiderpoolv1.PodIPAllocation {
 	if endpoint == nil {
-		return nil, false
+		return nil
 	}
 	if endpoint.Status.Current == nil {
-		return nil, false
+		return nil
 	}
 
 	if endpoint.Status.Current.ContainerID == containerID {
 		for _, d := range endpoint.Status.Current.IPs {
 			if d.NIC == nic {
-				return endpoint.Status.Current, true
+				return endpoint.Status.Current
 			}
 		}
 	}
 
-	if !includeHistory || len(endpoint.Status.History) <= 1 {
-		return nil, false
-	}
-
-	for _, a := range endpoint.Status.History[1:] {
-		if a.ContainerID == containerID {
-			for _, d := range a.IPs {
-				if d.NIC == nic {
-					return &a, false
-				}
-			}
-		}
-	}
-
-	return nil, false
+	return nil
 }
 
 // ListAllHistoricalIPs collect wep history IPs and classify them with each pool name.
diff --git a/pkg/workloadendpointmanager/workloadendpoint_manager.go b/pkg/workloadendpointmanager/workloadendpoint_manager.go
index f1da9367c..c8b90fc6a 100644
--- a/pkg/workloadendpointmanager/workloadendpoint_manager.go
+++ b/pkg/workloadendpointmanager/workloadendpoint_manager.go
@@ -20,7 +20,7 @@ import (
 	"github.com/spidernet-io/spiderpool/pkg/constant"
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"github.com/spidernet-io/spiderpool/pkg/podmanager"
+	"github.com/spidernet-io/spiderpool/pkg/types"
 )
 
 type WorkloadEndpointManager interface {
@@ -28,31 +28,26 @@ type WorkloadEndpointManager interface {
 	ListEndpoints(ctx context.Context, opts ...client.ListOption) (*spiderpoolv1.SpiderEndpointList, error)
 	DeleteEndpoint(ctx context.Context, endpoint *spiderpoolv1.SpiderEndpoint) error
 	RemoveFinalizer(ctx context.Context, namespace, podName string) error
-	MarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod) (*spiderpoolv1.SpiderEndpoint, error)
-	ReMarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod, endpoint *spiderpoolv1.SpiderEndpoint) error
+	MarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod, podController types.PodTopController) (*spiderpoolv1.SpiderEndpoint, error)
+	ReMarkIPAllocation(ctx context.Context, containerID string, endpoint *spiderpoolv1.SpiderEndpoint, pod *corev1.Pod) error
 	PatchIPAllocation(ctx context.Context, allocation *spiderpoolv1.PodIPAllocation, endpoint *spiderpoolv1.SpiderEndpoint) error
 	ClearCurrentIPAllocation(ctx context.Context, containerID string, endpoint *spiderpoolv1.SpiderEndpoint) error
-	ReallocateCurrentIPAllocation(ctx context.Context, containerID, nodeName, namespace, podName string) error
+	ReallocateCurrentIPAllocation(ctx context.Context, containerID, nodeName string, endpoint *spiderpoolv1.SpiderEndpoint) error
 }
 
 type workloadEndpointManager struct {
-	config     EndpointManagerConfig
-	client     client.Client
-	podManager podmanager.PodManager
+	config EndpointManagerConfig
+	client client.Client
 }
 
-func NewWorkloadEndpointManager(config EndpointManagerConfig, client client.Client, podManager podmanager.PodManager) (WorkloadEndpointManager, error) {
+func NewWorkloadEndpointManager(config EndpointManagerConfig, client client.Client) (WorkloadEndpointManager, error) {
 	if client == nil {
 		return nil, fmt.Errorf("k8s client %w", constant.ErrMissingRequiredParam)
 	}
-	if podManager == nil {
-		return nil, fmt.Errorf("pod manager %w", constant.ErrMissingRequiredParam)
-	}
 
 	return &workloadEndpointManager{
-		config:     setDefaultsForEndpointManagerConfig(config),
-		client:     client,
-		podManager: podManager,
+		config: setDefaultsForEndpointManagerConfig(config),
+		client: client,
 	}, nil
 }
 
@@ -110,11 +105,13 @@ func (em *workloadEndpointManager) RemoveFinalizer(ctx context.Context, namespac
 	return nil
 }
 
-func (em *workloadEndpointManager) MarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod) (*spiderpoolv1.SpiderEndpoint, error) {
+func (em *workloadEndpointManager) MarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod, podController types.PodTopController) (*spiderpoolv1.SpiderEndpoint, error) {
 	if pod == nil {
 		return nil, fmt.Errorf("pod %w", constant.ErrMissingRequiredParam)
 	}
 
+	logger := logutils.FromContext(ctx)
+
 	endpoint := &spiderpoolv1.SpiderEndpoint{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      pod.Name,
@@ -122,21 +119,18 @@ func (em *workloadEndpointManager) MarkIPAllocation(ctx context.Context, contain
 		},
 	}
 
-	podTopController, err := em.podManager.GetPodTopController(ctx, pod)
-	if err != nil {
-		return nil, err
-	}
-
 	// Do not set ownerReference for Endpoint when its corresponding Pod is
 	// controlled by StatefulSet. Once the Pod of StatefulSet is recreated,
 	// we can immediately retrieve the old IP allocation results from the
 	// Endpoint without worrying about the cascading deletion of the Endpoint.
-	if podTopController.Kind != constant.KindStatefulSet {
+	if podController.Kind != constant.KindStatefulSet {
 		if err := controllerutil.SetOwnerReference(pod, endpoint, em.config.scheme); err != nil {
 			return nil, err
 		}
 	}
 	controllerutil.AddFinalizer(endpoint, constant.SpiderFinalizer)
+
+	logger.Sugar().Debugf("Create a new Endpoint %s/%s", endpoint.Namespace, endpoint.Name)
 	if err := em.client.Create(ctx, endpoint); err != nil {
 		return nil, err
 	}
@@ -149,9 +143,10 @@ func (em *workloadEndpointManager) MarkIPAllocation(ctx context.Context, contain
 
 	endpoint.Status.Current = allocation
 	endpoint.Status.History = []spiderpoolv1.PodIPAllocation{*allocation}
-	endpoint.Status.OwnerControllerType = podTopController.Kind
-	endpoint.Status.OwnerControllerName = podTopController.Name
+	endpoint.Status.OwnerControllerType = podController.Kind
+	endpoint.Status.OwnerControllerName = podController.Name
 
+	logger.Sugar().Debugf("Update the current container ID of the new Endpoint %s/%s", endpoint.Namespace, endpoint.Name)
 	if err := em.client.Status().Update(ctx, endpoint); err != nil {
 		return nil, err
 	}
@@ -159,9 +154,7 @@ func (em *workloadEndpointManager) MarkIPAllocation(ctx context.Context, contain
 	return endpoint, nil
 }
 
-func (em *workloadEndpointManager) ReMarkIPAllocation(ctx context.Context, containerID string, pod *corev1.Pod, endpoint *spiderpoolv1.SpiderEndpoint) error {
-	logger := logutils.FromContext(ctx)
-
+func (em *workloadEndpointManager) ReMarkIPAllocation(ctx context.Context, containerID string, endpoint *spiderpoolv1.SpiderEndpoint, pod *corev1.Pod) error {
 	if pod == nil {
 		return fmt.Errorf("pod %w", constant.ErrMissingRequiredParam)
 	}
@@ -169,6 +162,8 @@ func (em *workloadEndpointManager) ReMarkIPAllocation(ctx context.Context, conta
 		return fmt.Errorf("endpoint %w", constant.ErrMissingRequiredParam)
 	}
 
+	logger := logutils.FromContext(ctx)
+
 	// Create -> Delete -> Create a Pod with the same namespace and name in
 	// a short time will cause some unexpected phenomena discussed in
 	// https://github.com/spidernet-io/spiderpool/issues/1187.
@@ -200,6 +195,8 @@ func (em *workloadEndpointManager) ReMarkIPAllocation(ctx context.Context, conta
 		endpoint.Status.History = endpoint.Status.History[:*em.config.MaxHistoryRecords]
 	}
 
+	logger.Sugar().Debugf("Change the current container ID of the Endpoint %s/%s", endpoint.Namespace, endpoint.Name)
+
 	return em.client.Status().Update(ctx, endpoint)
 }
 
@@ -225,46 +222,12 @@ func (em *workloadEndpointManager) PatchIPAllocation(ctx context.Context, alloca
 		return errors.New("patch a mismarked Endpoint")
 	}
 
-	var merged bool
-	for i, d := range endpoint.Status.Current.IPs {
-		if d.NIC == allocation.IPs[0].NIC {
-			mergeIPAllocationDetails(&endpoint.Status.Current.IPs[i], &allocation.IPs[0])
-			mergeIPAllocationDetails(&endpoint.Status.History[0].IPs[i], &allocation.IPs[0])
-			merged = true
-			break
-		}
-	}
-
-	if !merged {
-		endpoint.Status.Current.IPs = append(endpoint.Status.Current.IPs, allocation.IPs...)
-		endpoint.Status.History[0].IPs = append(endpoint.Status.History[0].IPs, allocation.IPs...)
-	}
+	endpoint.Status.Current.IPs = allocation.IPs
+	endpoint.Status.History = append([]spiderpoolv1.PodIPAllocation{*endpoint.Status.Current}, endpoint.Status.History...)
 
 	return em.client.Status().Update(ctx, endpoint)
 }
 
-func mergeIPAllocationDetails(target, delta *spiderpoolv1.IPAllocationDetail) {
-	if target.IPv4 == nil {
-		target.IPv4 = delta.IPv4
-	}
-	if target.IPv4Pool == nil {
-		target.IPv4Pool = delta.IPv4Pool
-	}
-	if target.IPv4Gateway == nil {
-		target.IPv4Gateway = delta.IPv4Gateway
-	}
-	if target.IPv6 == nil {
-		target.IPv6 = delta.IPv6
-	}
-	if target.IPv6Pool == nil {
-		target.IPv6Pool = delta.IPv6Pool
-	}
-	if target.IPv6Gateway == nil {
-		target.IPv6Gateway = delta.IPv6Gateway
-	}
-	target.Routes = append(target.Routes, delta.Routes...)
-}
-
 func (em *workloadEndpointManager) ClearCurrentIPAllocation(ctx context.Context, containerID string, endpoint *spiderpoolv1.SpiderEndpoint) error {
 	if endpoint == nil || endpoint.Status.Current == nil {
 		return nil
@@ -282,32 +245,22 @@ func (em *workloadEndpointManager) ClearCurrentIPAllocation(ctx context.Context,
 	return nil
 }
 
-func (em *workloadEndpointManager) ReallocateCurrentIPAllocation(ctx context.Context, containerID, nodeName, namespace, podName string) error {
-	for i := 0; i <= em.config.MaxConflictRetries; i++ {
-		endpoint, err := em.GetEndpointByName(ctx, namespace, podName)
-		if nil != err {
-			return err
-		}
+func (em *workloadEndpointManager) ReallocateCurrentIPAllocation(ctx context.Context, containerID, nodeName string, endpoint *spiderpoolv1.SpiderEndpoint) error {
+	if endpoint == nil {
+		return fmt.Errorf("endpoint %w", constant.ErrMissingRequiredParam)
+	}
 
-		if endpoint.Status.Current.ContainerID == containerID {
-			return nil
-		}
+	if endpoint.Status.Current == nil {
+		return errors.New("must be allocated befroe re-allocation")
+	}
 
-		endpoint.Status.Current.ContainerID = containerID
-		*endpoint.Status.Current.Node = nodeName
-		endpoint.Status.History = append([]spiderpoolv1.PodIPAllocation{*endpoint.Status.Current}, endpoint.Status.History...)
-		if err = em.client.Status().Update(ctx, endpoint); err != nil {
-			if !apierrors.IsConflict(err) {
-				return err
-			}
-			if i == em.config.MaxConflictRetries {
-				return fmt.Errorf("%w (%d times), failed to reallocate the Endpoint %s/%s of StatefulSet", constant.ErrRetriesExhausted, em.config.MaxConflictRetries, namespace, podName)
-			}
-			time.Sleep(time.Duration(rand.Intn(1<<(i+1))) * em.config.ConflictRetryUnitTime)
-			continue
-		}
-		break
+	if endpoint.Status.Current.ContainerID == containerID {
+		return nil
 	}
 
-	return nil
+	endpoint.Status.Current.ContainerID = containerID
+	*endpoint.Status.Current.Node = nodeName
+	endpoint.Status.History = append([]spiderpoolv1.PodIPAllocation{*endpoint.Status.Current}, endpoint.Status.History...)
+
+	return em.client.Status().Update(ctx, endpoint)
 }
diff --git a/pkg/workloadendpointmanager/workloadendpoint_mutate.go b/pkg/workloadendpointmanager/workloadendpoint_mutate.go
deleted file mode 100644
index 74380a970..000000000
--- a/pkg/workloadendpointmanager/workloadendpoint_mutate.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package workloadendpointmanager
-
-import (
-	"context"
-
-	"github.com/spidernet-io/spiderpool/pkg/constant"
-	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
-
-	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-)
-
-func (ew *WorkloadEndpointWebhook) mutateWorkloadEndpoint(ctx context.Context, endpoint *spiderpoolv1.SpiderEndpoint) error {
-	logger := logutils.FromContext(ctx)
-	logger.Info("Start to mutate Endpoint")
-
-	if endpoint.DeletionTimestamp != nil {
-		logger.Info("Terminating Endpoint, noting to mutate")
-		return nil
-	}
-
-	if !controllerutil.ContainsFinalizer(endpoint, constant.SpiderFinalizer) {
-		controllerutil.AddFinalizer(endpoint, constant.SpiderFinalizer)
-		logger.Sugar().Infof("Add finalizer %s", constant.SpiderFinalizer)
-	}
-
-	return nil
-}
diff --git a/pkg/workloadendpointmanager/workloadendpoint_webhook.go b/pkg/workloadendpointmanager/workloadendpoint_webhook.go
deleted file mode 100644
index 0a589f2b0..000000000
--- a/pkg/workloadendpointmanager/workloadendpoint_webhook.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package workloadendpointmanager
-
-import (
-	"context"
-
-	"go.uber.org/zap"
-	"k8s.io/apimachinery/pkg/runtime"
-	ctrl "sigs.k8s.io/controller-runtime"
-	"sigs.k8s.io/controller-runtime/pkg/webhook"
-
-	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	"github.com/spidernet-io/spiderpool/pkg/logutils"
-)
-
-var WebhookLogger *zap.Logger
-
-type WorkloadEndpointWebhook struct {
-}
-
-func (ew *WorkloadEndpointWebhook) SetupWebhookWithManager(mgr ctrl.Manager) error {
-	if WebhookLogger == nil {
-		WebhookLogger = logutils.Logger.Named("Endpoint-Webhook")
-	}
-
-	return ctrl.NewWebhookManagedBy(mgr).
-		For(&spiderpoolv1.SpiderEndpoint{}).
-		WithDefaulter(ew).
-		Complete()
-}
-
-var _ webhook.CustomDefaulter = (*WorkloadEndpointWebhook)(nil)
-
-// Default implements webhook.CustomDefaulter so a webhook will be registered for the type.
-func (ew *WorkloadEndpointWebhook) Default(ctx context.Context, obj runtime.Object) error {
-	endpoint := obj.(*spiderpoolv1.SpiderEndpoint)
-
-	logger := WebhookLogger.Named("Mutating").With(
-		zap.String("EndpointName", endpoint.Name),
-		zap.String("Operation", "DEFAULT"),
-	)
-	logger.Sugar().Debugf("Request Endpoint: %+v", *endpoint)
-
-	if err := ew.mutateWorkloadEndpoint(logutils.IntoContext(ctx, logger), endpoint); err != nil {
-		logger.Sugar().Errorf("Failed to mutate Endpoint: %v", err)
-	}
-
-	return nil
-}
diff --git a/vendor/github.com/golang/mock/AUTHORS b/vendor/github.com/golang/mock/AUTHORS
deleted file mode 100644
index 660b8ccc8..000000000
--- a/vendor/github.com/golang/mock/AUTHORS
+++ /dev/null
@@ -1,12 +0,0 @@
-# This is the official list of GoMock authors for copyright purposes.
-# This file is distinct from the CONTRIBUTORS files.
-# See the latter for an explanation.
-
-# Names should be added to this file as
-#	Name or Organization <email address>
-# The email address is not required for organizations.
-
-# Please keep the list sorted.
-
-Alex Reece <awreece@gmail.com>
-Google Inc.
diff --git a/vendor/github.com/golang/mock/CONTRIBUTORS b/vendor/github.com/golang/mock/CONTRIBUTORS
deleted file mode 100644
index def849cab..000000000
--- a/vendor/github.com/golang/mock/CONTRIBUTORS
+++ /dev/null
@@ -1,37 +0,0 @@
-# This is the official list of people who can contribute (and typically
-# have contributed) code to the gomock repository.
-# The AUTHORS file lists the copyright holders; this file
-# lists people.  For example, Google employees are listed here
-# but not in AUTHORS, because Google holds the copyright.
-#
-# The submission process automatically checks to make sure
-# that people submitting code are listed in this file (by email address).
-#
-# Names should be added to this file only after verifying that
-# the individual or the individual's organization has agreed to
-# the appropriate Contributor License Agreement, found here:
-#
-#     http://code.google.com/legal/individual-cla-v1.0.html
-#     http://code.google.com/legal/corporate-cla-v1.0.html
-#
-# The agreement for individuals can be filled out on the web.
-#
-# When adding J Random Contributor's name to this file,
-# either J's name or J's organization's name should be
-# added to the AUTHORS file, depending on whether the
-# individual or corporate CLA was used.
-
-# Names should be added to this file like so:
-#     Name <email address>
-#
-# An entry with two email addresses specifies that the
-# first address should be used in the submit logs and
-# that the second address should be recognized as the
-# same person when interacting with Rietveld.
-
-# Please keep the list sorted.
-
-Aaron Jacobs <jacobsa@google.com> <aaronjjacobs@gmail.com>
-Alex Reece <awreece@gmail.com>
-David Symonds <dsymonds@golang.org>
-Ryan Barrett <ryanb@google.com>
diff --git a/vendor/github.com/golang/mock/LICENSE b/vendor/github.com/golang/mock/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/vendor/github.com/golang/mock/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/github.com/golang/mock/gomock/call.go
deleted file mode 100644
index 13c9f44b1..000000000
--- a/vendor/github.com/golang/mock/gomock/call.go
+++ /dev/null
@@ -1,445 +0,0 @@
-// Copyright 2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package gomock
-
-import (
-	"fmt"
-	"reflect"
-	"strconv"
-	"strings"
-)
-
-// Call represents an expected call to a mock.
-type Call struct {
-	t TestHelper // for triggering test failures on invalid call setup
-
-	receiver   interface{}  // the receiver of the method call
-	method     string       // the name of the method
-	methodType reflect.Type // the type of the method
-	args       []Matcher    // the args
-	origin     string       // file and line number of call setup
-
-	preReqs []*Call // prerequisite calls
-
-	// Expectations
-	minCalls, maxCalls int
-
-	numCalls int // actual number made
-
-	// actions are called when this Call is called. Each action gets the args and
-	// can set the return values by returning a non-nil slice. Actions run in the
-	// order they are created.
-	actions []func([]interface{}) []interface{}
-}
-
-// newCall creates a *Call. It requires the method type in order to support
-// unexported methods.
-func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call {
-	t.Helper()
-
-	// TODO: check arity, types.
-	mArgs := make([]Matcher, len(args))
-	for i, arg := range args {
-		if m, ok := arg.(Matcher); ok {
-			mArgs[i] = m
-		} else if arg == nil {
-			// Handle nil specially so that passing a nil interface value
-			// will match the typed nils of concrete args.
-			mArgs[i] = Nil()
-		} else {
-			mArgs[i] = Eq(arg)
-		}
-	}
-
-	// callerInfo's skip should be updated if the number of calls between the user's test
-	// and this line changes, i.e. this code is wrapped in another anonymous function.
-	// 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test.
-	origin := callerInfo(3)
-	actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} {
-		// Synthesize the zero value for each of the return args' types.
-		rets := make([]interface{}, methodType.NumOut())
-		for i := 0; i < methodType.NumOut(); i++ {
-			rets[i] = reflect.Zero(methodType.Out(i)).Interface()
-		}
-		return rets
-	}}
-	return &Call{t: t, receiver: receiver, method: method, methodType: methodType,
-		args: mArgs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions}
-}
-
-// AnyTimes allows the expectation to be called 0 or more times
-func (c *Call) AnyTimes() *Call {
-	c.minCalls, c.maxCalls = 0, 1e8 // close enough to infinity
-	return c
-}
-
-// MinTimes requires the call to occur at least n times. If AnyTimes or MaxTimes have not been called or if MaxTimes
-// was previously called with 1, MinTimes also sets the maximum number of calls to infinity.
-func (c *Call) MinTimes(n int) *Call {
-	c.minCalls = n
-	if c.maxCalls == 1 {
-		c.maxCalls = 1e8
-	}
-	return c
-}
-
-// MaxTimes limits the number of calls to n times. If AnyTimes or MinTimes have not been called or if MinTimes was
-// previously called with 1, MaxTimes also sets the minimum number of calls to 0.
-func (c *Call) MaxTimes(n int) *Call {
-	c.maxCalls = n
-	if c.minCalls == 1 {
-		c.minCalls = 0
-	}
-	return c
-}
-
-// DoAndReturn declares the action to run when the call is matched.
-// The return values from this function are returned by the mocked function.
-// It takes an interface{} argument to support n-arity functions.
-func (c *Call) DoAndReturn(f interface{}) *Call {
-	// TODO: Check arity and types here, rather than dying badly elsewhere.
-	v := reflect.ValueOf(f)
-
-	c.addAction(func(args []interface{}) []interface{} {
-		c.t.Helper()
-		vArgs := make([]reflect.Value, len(args))
-		ft := v.Type()
-		if c.methodType.NumIn() != ft.NumIn() {
-			c.t.Fatalf("wrong number of arguments in DoAndReturn func for %T.%v: got %d, want %d [%s]",
-				c.receiver, c.method, ft.NumIn(), c.methodType.NumIn(), c.origin)
-			return nil
-		}
-		for i := 0; i < len(args); i++ {
-			if args[i] != nil {
-				vArgs[i] = reflect.ValueOf(args[i])
-			} else {
-				// Use the zero value for the arg.
-				vArgs[i] = reflect.Zero(ft.In(i))
-			}
-		}
-		vRets := v.Call(vArgs)
-		rets := make([]interface{}, len(vRets))
-		for i, ret := range vRets {
-			rets[i] = ret.Interface()
-		}
-		return rets
-	})
-	return c
-}
-
-// Do declares the action to run when the call is matched. The function's
-// return values are ignored to retain backward compatibility. To use the
-// return values call DoAndReturn.
-// It takes an interface{} argument to support n-arity functions.
-func (c *Call) Do(f interface{}) *Call {
-	// TODO: Check arity and types here, rather than dying badly elsewhere.
-	v := reflect.ValueOf(f)
-
-	c.addAction(func(args []interface{}) []interface{} {
-		c.t.Helper()
-		if c.methodType.NumIn() != v.Type().NumIn() {
-			c.t.Fatalf("wrong number of arguments in Do func for %T.%v: got %d, want %d [%s]",
-				c.receiver, c.method, v.Type().NumIn(), c.methodType.NumIn(), c.origin)
-			return nil
-		}
-		vArgs := make([]reflect.Value, len(args))
-		ft := v.Type()
-		for i := 0; i < len(args); i++ {
-			if args[i] != nil {
-				vArgs[i] = reflect.ValueOf(args[i])
-			} else {
-				// Use the zero value for the arg.
-				vArgs[i] = reflect.Zero(ft.In(i))
-			}
-		}
-		v.Call(vArgs)
-		return nil
-	})
-	return c
-}
-
-// Return declares the values to be returned by the mocked function call.
-func (c *Call) Return(rets ...interface{}) *Call {
-	c.t.Helper()
-
-	mt := c.methodType
-	if len(rets) != mt.NumOut() {
-		c.t.Fatalf("wrong number of arguments to Return for %T.%v: got %d, want %d [%s]",
-			c.receiver, c.method, len(rets), mt.NumOut(), c.origin)
-	}
-	for i, ret := range rets {
-		if got, want := reflect.TypeOf(ret), mt.Out(i); got == want {
-			// Identical types; nothing to do.
-		} else if got == nil {
-			// Nil needs special handling.
-			switch want.Kind() {
-			case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
-				// ok
-			default:
-				c.t.Fatalf("argument %d to Return for %T.%v is nil, but %v is not nillable [%s]",
-					i, c.receiver, c.method, want, c.origin)
-			}
-		} else if got.AssignableTo(want) {
-			// Assignable type relation. Make the assignment now so that the generated code
-			// can return the values with a type assertion.
-			v := reflect.New(want).Elem()
-			v.Set(reflect.ValueOf(ret))
-			rets[i] = v.Interface()
-		} else {
-			c.t.Fatalf("wrong type of argument %d to Return for %T.%v: %v is not assignable to %v [%s]",
-				i, c.receiver, c.method, got, want, c.origin)
-		}
-	}
-
-	c.addAction(func([]interface{}) []interface{} {
-		return rets
-	})
-
-	return c
-}
-
-// Times declares the exact number of times a function call is expected to be executed.
-func (c *Call) Times(n int) *Call {
-	c.minCalls, c.maxCalls = n, n
-	return c
-}
-
-// SetArg declares an action that will set the nth argument's value,
-// indirected through a pointer. Or, in the case of a slice, SetArg
-// will copy value's elements into the nth argument.
-func (c *Call) SetArg(n int, value interface{}) *Call {
-	c.t.Helper()
-
-	mt := c.methodType
-	// TODO: This will break on variadic methods.
-	// We will need to check those at invocation time.
-	if n < 0 || n >= mt.NumIn() {
-		c.t.Fatalf("SetArg(%d, ...) called for a method with %d args [%s]",
-			n, mt.NumIn(), c.origin)
-	}
-	// Permit setting argument through an interface.
-	// In the interface case, we don't (nay, can't) check the type here.
-	at := mt.In(n)
-	switch at.Kind() {
-	case reflect.Ptr:
-		dt := at.Elem()
-		if vt := reflect.TypeOf(value); !vt.AssignableTo(dt) {
-			c.t.Fatalf("SetArg(%d, ...) argument is a %v, not assignable to %v [%s]",
-				n, vt, dt, c.origin)
-		}
-	case reflect.Interface:
-		// nothing to do
-	case reflect.Slice:
-		// nothing to do
-	default:
-		c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice type %v [%s]",
-			n, at, c.origin)
-	}
-
-	c.addAction(func(args []interface{}) []interface{} {
-		v := reflect.ValueOf(value)
-		switch reflect.TypeOf(args[n]).Kind() {
-		case reflect.Slice:
-			setSlice(args[n], v)
-		default:
-			reflect.ValueOf(args[n]).Elem().Set(v)
-		}
-		return nil
-	})
-	return c
-}
-
-// isPreReq returns true if other is a direct or indirect prerequisite to c.
-func (c *Call) isPreReq(other *Call) bool {
-	for _, preReq := range c.preReqs {
-		if other == preReq || preReq.isPreReq(other) {
-			return true
-		}
-	}
-	return false
-}
-
-// After declares that the call may only match after preReq has been exhausted.
-func (c *Call) After(preReq *Call) *Call {
-	c.t.Helper()
-
-	if c == preReq {
-		c.t.Fatalf("A call isn't allowed to be its own prerequisite")
-	}
-	if preReq.isPreReq(c) {
-		c.t.Fatalf("Loop in call order: %v is a prerequisite to %v (possibly indirectly).", c, preReq)
-	}
-
-	c.preReqs = append(c.preReqs, preReq)
-	return c
-}
-
-// Returns true if the minimum number of calls have been made.
-func (c *Call) satisfied() bool {
-	return c.numCalls >= c.minCalls
-}
-
-// Returns true if the maximum number of calls have been made.
-func (c *Call) exhausted() bool {
-	return c.numCalls >= c.maxCalls
-}
-
-func (c *Call) String() string {
-	args := make([]string, len(c.args))
-	for i, arg := range c.args {
-		args[i] = arg.String()
-	}
-	arguments := strings.Join(args, ", ")
-	return fmt.Sprintf("%T.%v(%s) %s", c.receiver, c.method, arguments, c.origin)
-}
-
-// Tests if the given call matches the expected call.
-// If yes, returns nil. If no, returns error with message explaining why it does not match.
-func (c *Call) matches(args []interface{}) error {
-	if !c.methodType.IsVariadic() {
-		if len(args) != len(c.args) {
-			return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d",
-				c.origin, len(args), len(c.args))
-		}
-
-		for i, m := range c.args {
-			if !m.Matches(args[i]) {
-				return fmt.Errorf(
-					"expected call at %s doesn't match the argument at index %d.\nGot: %v\nWant: %v",
-					c.origin, i, formatGottenArg(m, args[i]), m,
-				)
-			}
-		}
-	} else {
-		if len(c.args) < c.methodType.NumIn()-1 {
-			return fmt.Errorf("expected call at %s has the wrong number of matchers. Got: %d, want: %d",
-				c.origin, len(c.args), c.methodType.NumIn()-1)
-		}
-		if len(c.args) != c.methodType.NumIn() && len(args) != len(c.args) {
-			return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d",
-				c.origin, len(args), len(c.args))
-		}
-		if len(args) < len(c.args)-1 {
-			return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: greater than or equal to %d",
-				c.origin, len(args), len(c.args)-1)
-		}
-
-		for i, m := range c.args {
-			if i < c.methodType.NumIn()-1 {
-				// Non-variadic args
-				if !m.Matches(args[i]) {
-					return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v",
-						c.origin, strconv.Itoa(i), formatGottenArg(m, args[i]), m)
-				}
-				continue
-			}
-			// The last arg has a possibility of a variadic argument, so let it branch
-
-			// sample: Foo(a int, b int, c ...int)
-			if i < len(c.args) && i < len(args) {
-				if m.Matches(args[i]) {
-					// Got Foo(a, b, c) want Foo(matcherA, matcherB, gomock.Any())
-					// Got Foo(a, b, c) want Foo(matcherA, matcherB, someSliceMatcher)
-					// Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC)
-					// Got Foo(a, b) want Foo(matcherA, matcherB)
-					// Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD)
-					continue
-				}
-			}
-
-			// The number of actual args don't match the number of matchers,
-			// or the last matcher is a slice and the last arg is not.
-			// If this function still matches it is because the last matcher
-			// matches all the remaining arguments or the lack of any.
-			// Convert the remaining arguments, if any, into a slice of the
-			// expected type.
-			vArgsType := c.methodType.In(c.methodType.NumIn() - 1)
-			vArgs := reflect.MakeSlice(vArgsType, 0, len(args)-i)
-			for _, arg := range args[i:] {
-				vArgs = reflect.Append(vArgs, reflect.ValueOf(arg))
-			}
-			if m.Matches(vArgs.Interface()) {
-				// Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, gomock.Any())
-				// Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, someSliceMatcher)
-				// Got Foo(a, b) want Foo(matcherA, matcherB, gomock.Any())
-				// Got Foo(a, b) want Foo(matcherA, matcherB, someEmptySliceMatcher)
-				break
-			}
-			// Wrong number of matchers or not match. Fail.
-			// Got Foo(a, b) want Foo(matcherA, matcherB, matcherC, matcherD)
-			// Got Foo(a, b, c) want Foo(matcherA, matcherB, matcherC, matcherD)
-			// Got Foo(a, b, c, d) want Foo(matcherA, matcherB, matcherC, matcherD, matcherE)
-			// Got Foo(a, b, c, d, e) want Foo(matcherA, matcherB, matcherC, matcherD)
-			// Got Foo(a, b, c) want Foo(matcherA, matcherB)
-
-			return fmt.Errorf("expected call at %s doesn't match the argument at index %s.\nGot: %v\nWant: %v",
-				c.origin, strconv.Itoa(i), formatGottenArg(m, args[i:]), c.args[i])
-		}
-	}
-
-	// Check that all prerequisite calls have been satisfied.
-	for _, preReqCall := range c.preReqs {
-		if !preReqCall.satisfied() {
-			return fmt.Errorf("expected call at %s doesn't have a prerequisite call satisfied:\n%v\nshould be called before:\n%v",
-				c.origin, preReqCall, c)
-		}
-	}
-
-	// Check that the call is not exhausted.
-	if c.exhausted() {
-		return fmt.Errorf("expected call at %s has already been called the max number of times", c.origin)
-	}
-
-	return nil
-}
-
-// dropPrereqs tells the expected Call to not re-check prerequisite calls any
-// longer, and to return its current set.
-func (c *Call) dropPrereqs() (preReqs []*Call) {
-	preReqs = c.preReqs
-	c.preReqs = nil
-	return
-}
-
-func (c *Call) call() []func([]interface{}) []interface{} {
-	c.numCalls++
-	return c.actions
-}
-
-// InOrder declares that the given calls should occur in order.
-func InOrder(calls ...*Call) {
-	for i := 1; i < len(calls); i++ {
-		calls[i].After(calls[i-1])
-	}
-}
-
-func setSlice(arg interface{}, v reflect.Value) {
-	va := reflect.ValueOf(arg)
-	for i := 0; i < v.Len(); i++ {
-		va.Index(i).Set(v.Index(i))
-	}
-}
-
-func (c *Call) addAction(action func([]interface{}) []interface{}) {
-	c.actions = append(c.actions, action)
-}
-
-func formatGottenArg(m Matcher, arg interface{}) string {
-	got := fmt.Sprintf("%v (%T)", arg, arg)
-	if gs, ok := m.(GotFormatter); ok {
-		got = gs.Got(arg)
-	}
-	return got
-}
diff --git a/vendor/github.com/golang/mock/gomock/callset.go b/vendor/github.com/golang/mock/gomock/callset.go
deleted file mode 100644
index 49dba787a..000000000
--- a/vendor/github.com/golang/mock/gomock/callset.go
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2011 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package gomock
-
-import (
-	"bytes"
-	"errors"
-	"fmt"
-)
-
-// callSet represents a set of expected calls, indexed by receiver and method
-// name.
-type callSet struct {
-	// Calls that are still expected.
-	expected map[callSetKey][]*Call
-	// Calls that have been exhausted.
-	exhausted map[callSetKey][]*Call
-}
-
-// callSetKey is the key in the maps in callSet
-type callSetKey struct {
-	receiver interface{}
-	fname    string
-}
-
-func newCallSet() *callSet {
-	return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)}
-}
-
-// Add adds a new expected call.
-func (cs callSet) Add(call *Call) {
-	key := callSetKey{call.receiver, call.method}
-	m := cs.expected
-	if call.exhausted() {
-		m = cs.exhausted
-	}
-	m[key] = append(m[key], call)
-}
-
-// Remove removes an expected call.
-func (cs callSet) Remove(call *Call) {
-	key := callSetKey{call.receiver, call.method}
-	calls := cs.expected[key]
-	for i, c := range calls {
-		if c == call {
-			// maintain order for remaining calls
-			cs.expected[key] = append(calls[:i], calls[i+1:]...)
-			cs.exhausted[key] = append(cs.exhausted[key], call)
-			break
-		}
-	}
-}
-
-// FindMatch searches for a matching call. Returns error with explanation message if no call matched.
-func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) {
-	key := callSetKey{receiver, method}
-
-	// Search through the expected calls.
-	expected := cs.expected[key]
-	var callsErrors bytes.Buffer
-	for _, call := range expected {
-		err := call.matches(args)
-		if err != nil {
-			_, _ = fmt.Fprintf(&callsErrors, "\n%v", err)
-		} else {
-			return call, nil
-		}
-	}
-
-	// If we haven't found a match then search through the exhausted calls so we
-	// get useful error messages.
-	exhausted := cs.exhausted[key]
-	for _, call := range exhausted {
-		if err := call.matches(args); err != nil {
-			_, _ = fmt.Fprintf(&callsErrors, "\n%v", err)
-			continue
-		}
-		_, _ = fmt.Fprintf(
-			&callsErrors, "all expected calls for method %q have been exhausted", method,
-		)
-	}
-
-	if len(expected)+len(exhausted) == 0 {
-		_, _ = fmt.Fprintf(&callsErrors, "there are no expected calls of the method %q for that receiver", method)
-	}
-
-	return nil, errors.New(callsErrors.String())
-}
-
-// Failures returns the calls that are not satisfied.
-func (cs callSet) Failures() []*Call {
-	failures := make([]*Call, 0, len(cs.expected))
-	for _, calls := range cs.expected {
-		for _, call := range calls {
-			if !call.satisfied() {
-				failures = append(failures, call)
-			}
-		}
-	}
-	return failures
-}
diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/github.com/golang/mock/gomock/controller.go
deleted file mode 100644
index f054200d5..000000000
--- a/vendor/github.com/golang/mock/gomock/controller.go
+++ /dev/null
@@ -1,336 +0,0 @@
-// Copyright 2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package gomock is a mock framework for Go.
-//
-// Standard usage:
-//   (1) Define an interface that you wish to mock.
-//         type MyInterface interface {
-//           SomeMethod(x int64, y string)
-//         }
-//   (2) Use mockgen to generate a mock from the interface.
-//   (3) Use the mock in a test:
-//         func TestMyThing(t *testing.T) {
-//           mockCtrl := gomock.NewController(t)
-//           defer mockCtrl.Finish()
-//
-//           mockObj := something.NewMockMyInterface(mockCtrl)
-//           mockObj.EXPECT().SomeMethod(4, "blah")
-//           // pass mockObj to a real object and play with it.
-//         }
-//
-// By default, expected calls are not enforced to run in any particular order.
-// Call order dependency can be enforced by use of InOrder and/or Call.After.
-// Call.After can create more varied call order dependencies, but InOrder is
-// often more convenient.
-//
-// The following examples create equivalent call order dependencies.
-//
-// Example of using Call.After to chain expected call order:
-//
-//     firstCall := mockObj.EXPECT().SomeMethod(1, "first")
-//     secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall)
-//     mockObj.EXPECT().SomeMethod(3, "third").After(secondCall)
-//
-// Example of using InOrder to declare expected call order:
-//
-//     gomock.InOrder(
-//         mockObj.EXPECT().SomeMethod(1, "first"),
-//         mockObj.EXPECT().SomeMethod(2, "second"),
-//         mockObj.EXPECT().SomeMethod(3, "third"),
-//     )
-package gomock
-
-import (
-	"context"
-	"fmt"
-	"reflect"
-	"runtime"
-	"sync"
-)
-
-// A TestReporter is something that can be used to report test failures.  It
-// is satisfied by the standard library's *testing.T.
-type TestReporter interface {
-	Errorf(format string, args ...interface{})
-	Fatalf(format string, args ...interface{})
-}
-
-// TestHelper is a TestReporter that has the Helper method.  It is satisfied
-// by the standard library's *testing.T.
-type TestHelper interface {
-	TestReporter
-	Helper()
-}
-
-// cleanuper is used to check if TestHelper also has the `Cleanup` method. A
-// common pattern is to pass in a `*testing.T` to
-// `NewController(t TestReporter)`. In Go 1.14+, `*testing.T` has a cleanup
-// method. This can be utilized to call `Finish()` so the caller of this library
-// does not have to.
-type cleanuper interface {
-	Cleanup(func())
-}
-
-// A Controller represents the top-level control of a mock ecosystem.  It
-// defines the scope and lifetime of mock objects, as well as their
-// expectations.  It is safe to call Controller's methods from multiple
-// goroutines. Each test should create a new Controller and invoke Finish via
-// defer.
-//
-//   func TestFoo(t *testing.T) {
-//     ctrl := gomock.NewController(t)
-//     defer ctrl.Finish()
-//     // ..
-//   }
-//
-//   func TestBar(t *testing.T) {
-//     t.Run("Sub-Test-1", st) {
-//       ctrl := gomock.NewController(st)
-//       defer ctrl.Finish()
-//       // ..
-//     })
-//     t.Run("Sub-Test-2", st) {
-//       ctrl := gomock.NewController(st)
-//       defer ctrl.Finish()
-//       // ..
-//     })
-//   })
-type Controller struct {
-	// T should only be called within a generated mock. It is not intended to
-	// be used in user code and may be changed in future versions. T is the
-	// TestReporter passed in when creating the Controller via NewController.
-	// If the TestReporter does not implement a TestHelper it will be wrapped
-	// with a nopTestHelper.
-	T             TestHelper
-	mu            sync.Mutex
-	expectedCalls *callSet
-	finished      bool
-}
-
-// NewController returns a new Controller. It is the preferred way to create a
-// Controller.
-//
-// New in go1.14+, if you are passing a *testing.T into this function you no
-// longer need to call ctrl.Finish() in your test methods.
-func NewController(t TestReporter) *Controller {
-	h, ok := t.(TestHelper)
-	if !ok {
-		h = &nopTestHelper{t}
-	}
-	ctrl := &Controller{
-		T:             h,
-		expectedCalls: newCallSet(),
-	}
-	if c, ok := isCleanuper(ctrl.T); ok {
-		c.Cleanup(func() {
-			ctrl.T.Helper()
-			ctrl.finish(true, nil)
-		})
-	}
-
-	return ctrl
-}
-
-type cancelReporter struct {
-	t      TestHelper
-	cancel func()
-}
-
-func (r *cancelReporter) Errorf(format string, args ...interface{}) {
-	r.t.Errorf(format, args...)
-}
-func (r *cancelReporter) Fatalf(format string, args ...interface{}) {
-	defer r.cancel()
-	r.t.Fatalf(format, args...)
-}
-
-func (r *cancelReporter) Helper() {
-	r.t.Helper()
-}
-
-// WithContext returns a new Controller and a Context, which is cancelled on any
-// fatal failure.
-func WithContext(ctx context.Context, t TestReporter) (*Controller, context.Context) {
-	h, ok := t.(TestHelper)
-	if !ok {
-		h = &nopTestHelper{t: t}
-	}
-
-	ctx, cancel := context.WithCancel(ctx)
-	return NewController(&cancelReporter{t: h, cancel: cancel}), ctx
-}
-
-type nopTestHelper struct {
-	t TestReporter
-}
-
-func (h *nopTestHelper) Errorf(format string, args ...interface{}) {
-	h.t.Errorf(format, args...)
-}
-func (h *nopTestHelper) Fatalf(format string, args ...interface{}) {
-	h.t.Fatalf(format, args...)
-}
-
-func (h nopTestHelper) Helper() {}
-
-// RecordCall is called by a mock. It should not be called by user code.
-func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call {
-	ctrl.T.Helper()
-
-	recv := reflect.ValueOf(receiver)
-	for i := 0; i < recv.Type().NumMethod(); i++ {
-		if recv.Type().Method(i).Name == method {
-			return ctrl.RecordCallWithMethodType(receiver, method, recv.Method(i).Type(), args...)
-		}
-	}
-	ctrl.T.Fatalf("gomock: failed finding method %s on %T", method, receiver)
-	panic("unreachable")
-}
-
-// RecordCallWithMethodType is called by a mock. It should not be called by user code.
-func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call {
-	ctrl.T.Helper()
-
-	call := newCall(ctrl.T, receiver, method, methodType, args...)
-
-	ctrl.mu.Lock()
-	defer ctrl.mu.Unlock()
-	ctrl.expectedCalls.Add(call)
-
-	return call
-}
-
-// Call is called by a mock. It should not be called by user code.
-func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} {
-	ctrl.T.Helper()
-
-	// Nest this code so we can use defer to make sure the lock is released.
-	actions := func() []func([]interface{}) []interface{} {
-		ctrl.T.Helper()
-		ctrl.mu.Lock()
-		defer ctrl.mu.Unlock()
-
-		expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args)
-		if err != nil {
-			// callerInfo's skip should be updated if the number of calls between the user's test
-			// and this line changes, i.e. this code is wrapped in another anonymous function.
-			// 0 is us, 1 is controller.Call(), 2 is the generated mock, and 3 is the user's test.
-			origin := callerInfo(3)
-			ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err)
-		}
-
-		// Two things happen here:
-		// * the matching call no longer needs to check prerequite calls,
-		// * and the prerequite calls are no longer expected, so remove them.
-		preReqCalls := expected.dropPrereqs()
-		for _, preReqCall := range preReqCalls {
-			ctrl.expectedCalls.Remove(preReqCall)
-		}
-
-		actions := expected.call()
-		if expected.exhausted() {
-			ctrl.expectedCalls.Remove(expected)
-		}
-		return actions
-	}()
-
-	var rets []interface{}
-	for _, action := range actions {
-		if r := action(args); r != nil {
-			rets = r
-		}
-	}
-
-	return rets
-}
-
-// Finish checks to see if all the methods that were expected to be called
-// were called. It should be invoked for each Controller. It is not idempotent
-// and therefore can only be invoked once.
-//
-// New in go1.14+, if you are passing a *testing.T into NewController function you no
-// longer need to call ctrl.Finish() in your test methods.
-func (ctrl *Controller) Finish() {
-	// If we're currently panicking, probably because this is a deferred call.
-	// This must be recovered in the deferred function.
-	err := recover()
-	ctrl.finish(false, err)
-}
-
-func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) {
-	ctrl.T.Helper()
-
-	ctrl.mu.Lock()
-	defer ctrl.mu.Unlock()
-
-	if ctrl.finished {
-		if _, ok := isCleanuper(ctrl.T); !ok {
-			ctrl.T.Fatalf("Controller.Finish was called more than once. It has to be called exactly once.")
-		}
-		return
-	}
-	ctrl.finished = true
-
-	// Short-circuit, pass through the panic.
-	if panicErr != nil {
-		panic(panicErr)
-	}
-
-	// Check that all remaining expected calls are satisfied.
-	failures := ctrl.expectedCalls.Failures()
-	for _, call := range failures {
-		ctrl.T.Errorf("missing call(s) to %v", call)
-	}
-	if len(failures) != 0 {
-		if !cleanup {
-			ctrl.T.Fatalf("aborting test due to missing call(s)")
-			return
-		}
-		ctrl.T.Errorf("aborting test due to missing call(s)")
-	}
-}
-
-// callerInfo returns the file:line of the call site. skip is the number
-// of stack frames to skip when reporting. 0 is callerInfo's call site.
-func callerInfo(skip int) string {
-	if _, file, line, ok := runtime.Caller(skip + 1); ok {
-		return fmt.Sprintf("%s:%d", file, line)
-	}
-	return "unknown file"
-}
-
-// isCleanuper checks it if t's base TestReporter has a Cleanup method.
-func isCleanuper(t TestReporter) (cleanuper, bool) {
-	tr := unwrapTestReporter(t)
-	c, ok := tr.(cleanuper)
-	return c, ok
-}
-
-// unwrapTestReporter unwraps TestReporter to the base implementation.
-func unwrapTestReporter(t TestReporter) TestReporter {
-	tr := t
-	switch nt := t.(type) {
-	case *cancelReporter:
-		tr = nt.t
-		if h, check := tr.(*nopTestHelper); check {
-			tr = h.t
-		}
-	case *nopTestHelper:
-		tr = nt.t
-	default:
-		// not wrapped
-	}
-	return tr
-}
diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/github.com/golang/mock/gomock/matchers.go
deleted file mode 100644
index 2822fb2c8..000000000
--- a/vendor/github.com/golang/mock/gomock/matchers.go
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright 2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package gomock
-
-import (
-	"fmt"
-	"reflect"
-	"strings"
-)
-
-// A Matcher is a representation of a class of values.
-// It is used to represent the valid or expected arguments to a mocked method.
-type Matcher interface {
-	// Matches returns whether x is a match.
-	Matches(x interface{}) bool
-
-	// String describes what the matcher matches.
-	String() string
-}
-
-// WantFormatter modifies the given Matcher's String() method to the given
-// Stringer. This allows for control on how the "Want" is formatted when
-// printing .
-func WantFormatter(s fmt.Stringer, m Matcher) Matcher {
-	type matcher interface {
-		Matches(x interface{}) bool
-	}
-
-	return struct {
-		matcher
-		fmt.Stringer
-	}{
-		matcher:  m,
-		Stringer: s,
-	}
-}
-
-// StringerFunc type is an adapter to allow the use of ordinary functions as
-// a Stringer. If f is a function with the appropriate signature,
-// StringerFunc(f) is a Stringer that calls f.
-type StringerFunc func() string
-
-// String implements fmt.Stringer.
-func (f StringerFunc) String() string {
-	return f()
-}
-
-// GotFormatter is used to better print failure messages. If a matcher
-// implements GotFormatter, it will use the result from Got when printing
-// the failure message.
-type GotFormatter interface {
-	// Got is invoked with the received value. The result is used when
-	// printing the failure message.
-	Got(got interface{}) string
-}
-
-// GotFormatterFunc type is an adapter to allow the use of ordinary
-// functions as a GotFormatter. If f is a function with the appropriate
-// signature, GotFormatterFunc(f) is a GotFormatter that calls f.
-type GotFormatterFunc func(got interface{}) string
-
-// Got implements GotFormatter.
-func (f GotFormatterFunc) Got(got interface{}) string {
-	return f(got)
-}
-
-// GotFormatterAdapter attaches a GotFormatter to a Matcher.
-func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher {
-	return struct {
-		GotFormatter
-		Matcher
-	}{
-		GotFormatter: s,
-		Matcher:      m,
-	}
-}
-
-type anyMatcher struct{}
-
-func (anyMatcher) Matches(interface{}) bool {
-	return true
-}
-
-func (anyMatcher) String() string {
-	return "is anything"
-}
-
-type eqMatcher struct {
-	x interface{}
-}
-
-func (e eqMatcher) Matches(x interface{}) bool {
-	// In case, some value is nil
-	if e.x == nil || x == nil {
-		return reflect.DeepEqual(e.x, x)
-	}
-
-	// Check if types assignable and convert them to common type
-	x1Val := reflect.ValueOf(e.x)
-	x2Val := reflect.ValueOf(x)
-
-	if x1Val.Type().AssignableTo(x2Val.Type()) {
-		x1ValConverted := x1Val.Convert(x2Val.Type())
-		return reflect.DeepEqual(x1ValConverted.Interface(), x2Val.Interface())
-	}
-
-	return false
-}
-
-func (e eqMatcher) String() string {
-	return fmt.Sprintf("is equal to %v (%T)", e.x, e.x)
-}
-
-type nilMatcher struct{}
-
-func (nilMatcher) Matches(x interface{}) bool {
-	if x == nil {
-		return true
-	}
-
-	v := reflect.ValueOf(x)
-	switch v.Kind() {
-	case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map,
-		reflect.Ptr, reflect.Slice:
-		return v.IsNil()
-	}
-
-	return false
-}
-
-func (nilMatcher) String() string {
-	return "is nil"
-}
-
-type notMatcher struct {
-	m Matcher
-}
-
-func (n notMatcher) Matches(x interface{}) bool {
-	return !n.m.Matches(x)
-}
-
-func (n notMatcher) String() string {
-	return "not(" + n.m.String() + ")"
-}
-
-type assignableToTypeOfMatcher struct {
-	targetType reflect.Type
-}
-
-func (m assignableToTypeOfMatcher) Matches(x interface{}) bool {
-	return reflect.TypeOf(x).AssignableTo(m.targetType)
-}
-
-func (m assignableToTypeOfMatcher) String() string {
-	return "is assignable to " + m.targetType.Name()
-}
-
-type allMatcher struct {
-	matchers []Matcher
-}
-
-func (am allMatcher) Matches(x interface{}) bool {
-	for _, m := range am.matchers {
-		if !m.Matches(x) {
-			return false
-		}
-	}
-	return true
-}
-
-func (am allMatcher) String() string {
-	ss := make([]string, 0, len(am.matchers))
-	for _, matcher := range am.matchers {
-		ss = append(ss, matcher.String())
-	}
-	return strings.Join(ss, "; ")
-}
-
-type lenMatcher struct {
-	i int
-}
-
-func (m lenMatcher) Matches(x interface{}) bool {
-	v := reflect.ValueOf(x)
-	switch v.Kind() {
-	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String:
-		return v.Len() == m.i
-	default:
-		return false
-	}
-}
-
-func (m lenMatcher) String() string {
-	return fmt.Sprintf("has length %d", m.i)
-}
-
-type inAnyOrderMatcher struct {
-	x interface{}
-}
-
-func (m inAnyOrderMatcher) Matches(x interface{}) bool {
-	given, ok := m.prepareValue(x)
-	if !ok {
-		return false
-	}
-	wanted, ok := m.prepareValue(m.x)
-	if !ok {
-		return false
-	}
-
-	if given.Len() != wanted.Len() {
-		return false
-	}
-
-	usedFromGiven := make([]bool, given.Len())
-	foundFromWanted := make([]bool, wanted.Len())
-	for i := 0; i < wanted.Len(); i++ {
-		wantedMatcher := Eq(wanted.Index(i).Interface())
-		for j := 0; j < given.Len(); j++ {
-			if usedFromGiven[j] {
-				continue
-			}
-			if wantedMatcher.Matches(given.Index(j).Interface()) {
-				foundFromWanted[i] = true
-				usedFromGiven[j] = true
-				break
-			}
-		}
-	}
-
-	missingFromWanted := 0
-	for _, found := range foundFromWanted {
-		if !found {
-			missingFromWanted++
-		}
-	}
-	extraInGiven := 0
-	for _, used := range usedFromGiven {
-		if !used {
-			extraInGiven++
-		}
-	}
-
-	return extraInGiven == 0 && missingFromWanted == 0
-}
-
-func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) {
-	xValue := reflect.ValueOf(x)
-	switch xValue.Kind() {
-	case reflect.Slice, reflect.Array:
-		return xValue, true
-	default:
-		return reflect.Value{}, false
-	}
-}
-
-func (m inAnyOrderMatcher) String() string {
-	return fmt.Sprintf("has the same elements as %v", m.x)
-}
-
-// Constructors
-
-// All returns a composite Matcher that returns true if and only all of the
-// matchers return true.
-func All(ms ...Matcher) Matcher { return allMatcher{ms} }
-
-// Any returns a matcher that always matches.
-func Any() Matcher { return anyMatcher{} }
-
-// Eq returns a matcher that matches on equality.
-//
-// Example usage:
-//   Eq(5).Matches(5) // returns true
-//   Eq(5).Matches(4) // returns false
-func Eq(x interface{}) Matcher { return eqMatcher{x} }
-
-// Len returns a matcher that matches on length. This matcher returns false if
-// is compared to a type that is not an array, chan, map, slice, or string.
-func Len(i int) Matcher {
-	return lenMatcher{i}
-}
-
-// Nil returns a matcher that matches if the received value is nil.
-//
-// Example usage:
-//   var x *bytes.Buffer
-//   Nil().Matches(x) // returns true
-//   x = &bytes.Buffer{}
-//   Nil().Matches(x) // returns false
-func Nil() Matcher { return nilMatcher{} }
-
-// Not reverses the results of its given child matcher.
-//
-// Example usage:
-//   Not(Eq(5)).Matches(4) // returns true
-//   Not(Eq(5)).Matches(5) // returns false
-func Not(x interface{}) Matcher {
-	if m, ok := x.(Matcher); ok {
-		return notMatcher{m}
-	}
-	return notMatcher{Eq(x)}
-}
-
-// AssignableToTypeOf is a Matcher that matches if the parameter to the mock
-// function is assignable to the type of the parameter to this function.
-//
-// Example usage:
-//   var s fmt.Stringer = &bytes.Buffer{}
-//   AssignableToTypeOf(s).Matches(time.Second) // returns true
-//   AssignableToTypeOf(s).Matches(99) // returns false
-//
-//   var ctx = reflect.TypeOf((*context.Context)(nil)).Elem()
-//   AssignableToTypeOf(ctx).Matches(context.Background()) // returns true
-func AssignableToTypeOf(x interface{}) Matcher {
-	if xt, ok := x.(reflect.Type); ok {
-		return assignableToTypeOfMatcher{xt}
-	}
-	return assignableToTypeOfMatcher{reflect.TypeOf(x)}
-}
-
-// InAnyOrder is a Matcher that returns true for collections of the same elements ignoring the order.
-//
-// Example usage:
-//   InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true
-//   InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false
-func InAnyOrder(x interface{}) Matcher {
-	return inAnyOrderMatcher{x}
-}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index bc3aaa646..86fcf2442 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -170,9 +170,6 @@ github.com/golang-jwt/jwt/v4
 # github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
 ## explicit
 github.com/golang/groupcache/lru
-# github.com/golang/mock v1.6.0
-## explicit; go 1.11
-github.com/golang/mock/gomock
 # github.com/golang/protobuf v1.5.2
 ## explicit; go 1.9
 github.com/golang/protobuf/proto


Test patch:
diff --git a/.github/workflows/e2e-init.yaml b/.github/workflows/e2e-init.yaml
index f43544519..3513eb981 100644
--- a/.github/workflows/e2e-init.yaml
+++ b/.github/workflows/e2e-init.yaml
@@ -52,7 +52,7 @@ jobs:
       - name: Setup Golang
         uses: actions/setup-go@v3
         with:
-          go-version: 1.19.0
+          go-version: 1.20.0
           id: go
 
       # https://github.com/helm/kind-action
diff --git a/pkg/limiter/queue_test.go b/pkg/limiter/queue_test.go
index 206fea3f4..8b0a6da15 100644
--- a/pkg/limiter/queue_test.go
+++ b/pkg/limiter/queue_test.go
@@ -5,8 +5,6 @@ package limiter_test
 
 import (
 	"context"
-	"math/rand"
-	"strconv"
 	"sync"
 	"time"
 
@@ -34,10 +32,7 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 			ctx, cancel = context.WithCancel(context.Background())
 			DeferCleanup(cancel)
 
-			maxWaitTime := 0 * time.Second
-			config = limiter.LimiterConfig{
-				MaxWaitTime: &maxWaitTime,
-			}
+			config = limiter.LimiterConfig{}
 		})
 
 		It("forgets to start the limiter", func() {
@@ -45,11 +40,29 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 			Expect(queue).NotTo(BeNil())
 
 			ctx := context.TODO()
-			reason, err := queue.AcquireTicket(ctx)
-			Expect(err).To(MatchError(limiter.ErrUnexpectedBlocking))
-			Expect(reason).To(Equal(limiter.UnexpectedBlocking))
+			err := queue.AcquireTicket(ctx)
+			Expect(err).To(MatchError(limiter.ErrShutdownQueue))
 			queue.ReleaseTicket(ctx)
 		})
+
+		It("repeatedly starts the limiter", func() {
+			queue := limiter.NewLimiter(config)
+			Expect(queue).NotTo(BeNil())
+
+			ctx, cancel = context.WithCancel(context.Background())
+			defer cancel()
+
+			go func() {
+				defer GinkgoRecover()
+				err := queue.Start(ctx)
+				Expect(err).NotTo(HaveOccurred())
+			}()
+
+			Eventually(queue.Started).Should(BeTrue())
+
+			err := queue.Start(ctx)
+			Expect(err).To(MatchError(limiter.ErrStartLimiteRrepeatedly))
+		})
 	})
 
 	Describe("General", func() {
@@ -65,6 +78,8 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 				err := queue.Start(ctx)
 				Expect(err).NotTo(HaveOccurred())
 			}()
+
+			Eventually(queue.Started).Should(BeTrue())
 		})
 
 		Context("Use", func() {
@@ -73,10 +88,8 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 				DeferCleanup(cancel)
 
 				maxQueueSize := 3
-				maxWaitTime := 2 * time.Second
 				config = limiter.LimiterConfig{
 					MaxQueueSize: &maxQueueSize,
-					MaxWaitTime:  &maxWaitTime,
 				}
 				queuers = 3
 				workHours = 1 * time.Second
@@ -84,35 +97,11 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 
 			It("acquires tickets", func() {
 				ctx := context.TODO()
-				reason, err := queue.AcquireTicket(ctx)
+				err := queue.AcquireTicket(ctx)
 				Expect(err).NotTo(HaveOccurred())
-				Expect(reason).To(Equal(limiter.Checkin))
 				queue.ReleaseTicket(ctx)
 			})
 
-			It("acquires tickets but timeout", func() {
-				ctx := context.TODO()
-				reasonCh := make(chan limiter.Reason, queuers)
-				wg := sync.WaitGroup{}
-				wg.Add(queuers)
-				for i := 0; i < queuers; i++ {
-					go func() {
-						defer GinkgoRecover()
-						defer wg.Done()
-
-						reason, err := queue.AcquireTicket(ctx)
-						Expect(err).NotTo(HaveOccurred())
-						reasonCh <- reason
-
-						time.Sleep(workHours)
-						queue.ReleaseTicket(ctx)
-					}()
-				}
-				wg.Wait()
-				// Eventually some queuers will wait timeout due to slow consumption.
-				Eventually(reasonCh).Should(Receive(Equal(limiter.CheckinTimeout)))
-			})
-
 			It("acquires tickets but queue is full", func() {
 				ctx := context.TODO()
 				wg := sync.WaitGroup{}
@@ -122,7 +111,7 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 						defer GinkgoRecover()
 						defer wg.Done()
 
-						_, err := queue.AcquireTicket(ctx)
+						err := queue.AcquireTicket(ctx)
 						if err != nil {
 							Expect(err).To(MatchError(limiter.ErrFullQueue))
 							return
@@ -137,69 +126,16 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 		})
 
 		Context("Concurrency", func() {
-			var ticketSize int
-			var randomTicket func(int) []string
-
 			BeforeEach(func() {
 				ctx, cancel = context.WithCancel(context.Background())
 				DeferCleanup(cancel)
 
 				maxQueueSize := 200
-				maxWaitTime := 5 * time.Second
 				config = limiter.LimiterConfig{
 					MaxQueueSize: &maxQueueSize,
-					MaxWaitTime:  &maxWaitTime,
 				}
 				queuers = 200
 				workHours = 50 * time.Millisecond
-
-				ticketSize = 3
-				randomTicket = func(ticketSize int) []string {
-					var tickets []string
-					rand.Seed(time.Now().UnixNano())
-					n := rand.Intn(ticketSize) + 1
-					for i := 0; i < n; i++ {
-						tickets = append(tickets, "t"+strconv.Itoa(rand.Intn(ticketSize)+1))
-					}
-
-					return tickets
-				}
-			})
-
-			It("collects the conflict rate when consumption is too slow", func() {
-				ctx := context.TODO()
-				reasonCh := make(chan limiter.Reason, queuers)
-				wg := sync.WaitGroup{}
-				wg.Add(queuers)
-				for i := 0; i < queuers; i++ {
-					go func() {
-						defer GinkgoRecover()
-						defer wg.Done()
-
-						tickets := randomTicket(ticketSize)
-						reason, err := queue.AcquireTicket(ctx, tickets...)
-						Expect(err).NotTo(HaveOccurred())
-						reasonCh <- reason
-
-						time.Sleep(workHours)
-						queue.ReleaseTicket(ctx, tickets...)
-					}()
-				}
-				wg.Wait()
-				close(reasonCh)
-
-				var checkin, checkinTimeout int
-				for r := range reasonCh {
-					if r == limiter.Checkin {
-						checkin++
-					} else if r == limiter.CheckinTimeout {
-						checkinTimeout++
-					}
-				}
-
-				GinkgoWriter.Printf("%d queuers who take %v to work queue in a queue with a maximum waiting time %v\n", queuers, workHours, config.MaxWaitTime)
-				GinkgoWriter.Printf("%d queuers completed their work without conflict\n", checkin)
-				GinkgoWriter.Printf("%d queuers work concurrently due to waiting timeout\n", checkinTimeout)
 			})
 		})
 
@@ -209,10 +145,8 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 				DeferCleanup(cancel)
 
 				maxQueueSize := 3
-				maxWaitTime := 2 * time.Second
 				config = limiter.LimiterConfig{
 					MaxQueueSize: &maxQueueSize,
-					MaxWaitTime:  &maxWaitTime,
 				}
 				queuers = 3
 				workHours = 1 * time.Second
@@ -231,7 +165,7 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 						defer GinkgoRecover()
 						defer wg.Done()
 
-						_, err := queue.AcquireTicket(ctx)
+						err := queue.AcquireTicket(ctx)
 						Expect(err).NotTo(HaveOccurred())
 
 						time.Sleep(workHours)
@@ -248,7 +182,7 @@ var _ = Describe("Limiter", Label("queue_test"), func() {
 				cancel()
 				time.Sleep(1 * time.Second)
 
-				_, err := queue.AcquireTicket(ctx)
+				err := queue.AcquireTicket(ctx)
 				Expect(err).To(MatchError(limiter.ErrShutdownQueue))
 			})
 		})
diff --git a/pkg/namespacemanager/namespace_manager_test.go b/pkg/namespacemanager/namespace_manager_test.go
index e5eb329dc..8b29ded68 100644
--- a/pkg/namespacemanager/namespace_manager_test.go
+++ b/pkg/namespacemanager/namespace_manager_test.go
@@ -159,62 +159,5 @@ var _ = Describe("NamespaceManager", Label("namespace_manager_test"), func() {
 				Expect(hasNS).To(BeTrue())
 			})
 		})
-
-		Describe("MatchLabelSelector", func() {
-			It("checks non-existent Namespace", func() {
-				ctx := context.TODO()
-				match, err := nsManager.MatchLabelSelector(ctx, nsName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches invalid label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nsT)
-				Expect(err).NotTo(HaveOccurred())
-
-				invalidSelector := &metav1.LabelSelector{
-					MatchLabels: map[string]string{
-						"": "",
-					},
-				}
-				match, err := nsManager.MatchLabelSelector(ctx, nsName, invalidSelector)
-				Expect(err).To(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("failed to list Namespace due to some unknown errors", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient, "List", constant.ErrUnknown)
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nsT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nsManager.MatchLabelSelector(ctx, nsName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).To(MatchError(constant.ErrUnknown))
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches nothing", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nsT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nsManager.MatchLabelSelector(ctx, nsName, nil)
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches the label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nsT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nsManager.MatchLabelSelector(ctx, nsName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeTrue())
-			})
-		})
 	})
 })
diff --git a/pkg/nodemanager/node_manager_test.go b/pkg/nodemanager/node_manager_test.go
index 8698e6d16..e46c10660 100644
--- a/pkg/nodemanager/node_manager_test.go
+++ b/pkg/nodemanager/node_manager_test.go
@@ -159,62 +159,5 @@ var _ = Describe("NodeManager", Label("node_manager_test"), func() {
 				Expect(hasNode).To(BeTrue())
 			})
 		})
-
-		Describe("MatchLabelSelector", func() {
-			It("checks non-existent Node", func() {
-				ctx := context.TODO()
-				match, err := nodeManager.MatchLabelSelector(ctx, nodeName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches invalid label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nodeT)
-				Expect(err).NotTo(HaveOccurred())
-
-				invalidSelector := &metav1.LabelSelector{
-					MatchLabels: map[string]string{
-						"": "",
-					},
-				}
-				match, err := nodeManager.MatchLabelSelector(ctx, nodeName, invalidSelector)
-				Expect(err).To(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("failed to list Nodes due to some unknown errors", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient, "List", constant.ErrUnknown)
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nodeT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nodeManager.MatchLabelSelector(ctx, nodeName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).To(MatchError(constant.ErrUnknown))
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches nothing", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nodeT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nodeManager.MatchLabelSelector(ctx, nodeName, nil)
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches the label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, nodeT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := nodeManager.MatchLabelSelector(ctx, nodeName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeTrue())
-			})
-		})
 	})
 })
diff --git a/pkg/podmanager/pod_manager_test.go b/pkg/podmanager/pod_manager_test.go
index 2985a0daf..3446d79f4 100644
--- a/pkg/podmanager/pod_manager_test.go
+++ b/pkg/podmanager/pod_manager_test.go
@@ -18,8 +18,6 @@ import (
 	corev1 "k8s.io/api/core/v1"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/apimachinery/pkg/runtime/schema"
-	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/utils/pointer"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
@@ -198,136 +196,6 @@ var _ = Describe("PodManager", Label("pod_manager_test"), func() {
 			})
 		})
 
-		Describe("MatchLabelSelector", func() {
-			It("checks non-existent Pod", func() {
-				ctx := context.TODO()
-				match, err := podManager.MatchLabelSelector(ctx, namespace, podName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches invalid label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				invalidSelector := &metav1.LabelSelector{
-					MatchLabels: map[string]string{
-						"": "",
-					},
-				}
-				match, err := podManager.MatchLabelSelector(ctx, namespace, podName, invalidSelector)
-				Expect(err).To(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("failed to list Pods due to some unknown errors", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient, "List", constant.ErrUnknown)
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := podManager.MatchLabelSelector(ctx, namespace, podName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).To(MatchError(constant.ErrUnknown))
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches nothing", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := podManager.MatchLabelSelector(ctx, namespace, podName, nil)
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeFalse())
-			})
-
-			It("matches the label selector", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				match, err := podManager.MatchLabelSelector(ctx, namespace, podName, &metav1.LabelSelector{MatchLabels: labels})
-				Expect(err).NotTo(HaveOccurred())
-				Expect(match).To(BeTrue())
-			})
-		})
-
-		Describe("MergeAnnotations", func() {
-			It("merges annotations to non-existent Pod", func() {
-				ctx := context.TODO()
-				anno := map[string]string{"foo": "bar"}
-				err := podManager.MergeAnnotations(ctx, namespace, podName, anno)
-				Expect(apierrors.IsNotFound(err)).To(BeTrue())
-			})
-
-			It("merges empty annotations", func() {
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				err = podManager.MergeAnnotations(ctx, namespace, podName, nil)
-				Expect(err).NotTo(HaveOccurred())
-			})
-
-			It("failed to update Pod due to some unknown errors", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient, "Update", constant.ErrUnknown)
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				anno := map[string]string{"foo": "bar"}
-				err = podManager.MergeAnnotations(ctx, namespace, podName, anno)
-				Expect(err).To(MatchError(constant.ErrUnknown))
-			})
-
-			It("runs out of retries to update Pod, but conflicts still occur", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient, "Update", apierrors.NewConflict(schema.GroupResource{Resource: "test"}, "other", nil))
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				anno := map[string]string{"foo": "bar"}
-				err = podManager.MergeAnnotations(ctx, namespace, podName, anno)
-				Expect(err).To(MatchError(constant.ErrRetriesExhausted))
-			})
-
-			It("merges annotations to Pod", func() {
-				podT.SetAnnotations(map[string]string{
-					"foo":   "merge",
-					"exist": "value",
-				})
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, podT)
-				Expect(err).NotTo(HaveOccurred())
-
-				anno := map[string]string{
-					"foo": "bar",
-					"new": "value",
-				}
-				err = podManager.MergeAnnotations(ctx, namespace, podName, anno)
-				Expect(err).NotTo(HaveOccurred())
-
-				var pod corev1.Pod
-				err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: podName}, &pod)
-				Expect(err).NotTo(HaveOccurred())
-				Expect(pod.GetAnnotations()).To(Equal(
-					map[string]string{
-						"foo":   "bar",
-						"exist": "value",
-						"new":   "value",
-					},
-				))
-			})
-		})
-
 		Describe("GetPodTopController", func() {
 			It("Orphan Pod without any controllers", func() {
 				podTopController, err := podManager.GetPodTopController(ctx, podT)
diff --git a/pkg/reservedipmanager/reservedip_manager_test.go b/pkg/reservedipmanager/reservedip_manager_test.go
index f2a4f8d1f..4251f1bcd 100644
--- a/pkg/reservedipmanager/reservedip_manager_test.go
+++ b/pkg/reservedipmanager/reservedip_manager_test.go
@@ -6,6 +6,7 @@ package reservedipmanager_test
 import (
 	"context"
 	"fmt"
+	"net"
 	"sync/atomic"
 
 	"github.com/agiledragon/gomonkey/v2"
@@ -17,6 +18,7 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
 	"github.com/spidernet-io/spiderpool/pkg/constant"
+	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
 	"github.com/spidernet-io/spiderpool/pkg/reservedipmanager"
 )
@@ -34,7 +36,7 @@ var _ = Describe("ReservedIPManager", Label("reservedip_manager_test"), func() {
 		var count uint64
 		var rIPName string
 		var labels map[string]string
-		var rIPT *spiderpoolv1.SpiderReservedIP
+		var rIPT, terminatingV4RIPT *spiderpoolv1.SpiderReservedIP
 
 		BeforeEach(func() {
 			atomic.AddUint64(&count, 1)
@@ -51,6 +53,25 @@ var _ = Describe("ReservedIPManager", Label("reservedip_manager_test"), func() {
 				},
 				Spec: spiderpoolv1.ReservedIPSpec{},
 			}
+
+			now := metav1.Now()
+			terminatingV4RIPT = &spiderpoolv1.SpiderReservedIP{
+				TypeMeta: metav1.TypeMeta{
+					Kind:       constant.SpiderReservedIPKind,
+					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
+				},
+				ObjectMeta: metav1.ObjectMeta{
+					Name:                       "terminating-ipv4-reservedip",
+					DeletionTimestamp:          &now,
+					DeletionGracePeriodSeconds: pointer.Int64(30),
+				},
+				Spec: spiderpoolv1.ReservedIPSpec{
+					IPVersion: pointer.Int64(constant.IPv4),
+					IPs: []string{
+						"172.18.40.40",
+					},
+				},
+			}
 		})
 
 		var deleteOption *client.DeleteOptions
@@ -65,6 +86,9 @@ var _ = Describe("ReservedIPManager", Label("reservedip_manager_test"), func() {
 			ctx := context.TODO()
 			err := fakeClient.Delete(ctx, rIPT, deleteOption)
 			Expect(client.IgnoreNotFound(err)).NotTo(HaveOccurred())
+
+			err = fakeClient.Delete(ctx, terminatingV4RIPT, deleteOption)
+			Expect(client.IgnoreNotFound(err)).NotTo(HaveOccurred())
 		})
 
 		Describe("GetReservedIPByName", func() {
@@ -159,5 +183,62 @@ var _ = Describe("ReservedIPManager", Label("reservedip_manager_test"), func() {
 				Expect(hasRIP).To(BeTrue())
 			})
 		})
+
+		Describe("AssembleReservedIPs", func() {
+			It("inputs invalid IP version", func() {
+				ctx := context.TODO()
+				ips, err := rIPManager.AssembleReservedIPs(ctx, constant.InvalidIPVersion)
+				Expect(err).To(MatchError(spiderpoolip.ErrInvalidIPVersion))
+				Expect(ips).To(BeEmpty())
+			})
+
+			It("failed to list ReservedIPs due to some unknown errors", func() {
+				patches := gomonkey.ApplyMethodReturn(fakeClient, "List", constant.ErrUnknown)
+				defer patches.Reset()
+
+				ctx := context.TODO()
+				ips, err := rIPManager.AssembleReservedIPs(ctx, constant.IPv4)
+				Expect(err).To(MatchError(constant.ErrUnknown))
+				Expect(ips).To(BeEmpty())
+			})
+
+			It("does not assemble terminating IPv4 reserved-IP addresses", func() {
+				rIPT.Spec.IPVersion = pointer.Int64(constant.IPv4)
+				rIPT.Spec.IPs = []string{
+					"172.18.40.1-172.18.40.2",
+					"172.18.40.10",
+				}
+
+				ctx := context.TODO()
+				err := fakeClient.Create(ctx, rIPT)
+				Expect(err).NotTo(HaveOccurred())
+
+				err = fakeClient.Create(ctx, terminatingV4RIPT)
+				Expect(err).NotTo(HaveOccurred())
+
+				ips, err := rIPManager.AssembleReservedIPs(ctx, constant.IPv4)
+				Expect(err).NotTo(HaveOccurred())
+				Expect(ips).To(Equal(
+					[]net.IP{
+						net.IPv4(172, 18, 40, 1),
+						net.IPv4(172, 18, 40, 2),
+						net.IPv4(172, 18, 40, 10),
+					},
+				))
+			})
+
+			It("exists invalid ReservedIPs in the cluster", func() {
+				rIPT.Spec.IPVersion = pointer.Int64(constant.IPv4)
+				rIPT.Spec.IPs = append(rIPT.Spec.IPs, constant.InvalidIPRange)
+
+				ctx := context.TODO()
+				err := fakeClient.Create(ctx, rIPT)
+				Expect(err).NotTo(HaveOccurred())
+
+				ips, err := rIPManager.AssembleReservedIPs(ctx, constant.IPv4)
+				Expect(err).To(MatchError(spiderpoolip.ErrInvalidIPRangeFormat))
+				Expect(ips).To(BeEmpty())
+			})
+		})
 	})
 })
diff --git a/pkg/reservedipmanager/utils_test.go b/pkg/reservedipmanager/utils_test.go
deleted file mode 100644
index 4a1c67275..000000000
--- a/pkg/reservedipmanager/utils_test.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2022 Authors of spidernet-io
-// SPDX-License-Identifier: Apache-2.0
-
-package reservedipmanager_test
-
-import (
-	"fmt"
-	"net"
-
-	. "github.com/onsi/ginkgo/v2"
-	. "github.com/onsi/gomega"
-
-	"github.com/spidernet-io/spiderpool/pkg/constant"
-	spiderpoolip "github.com/spidernet-io/spiderpool/pkg/ip"
-	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	"github.com/spidernet-io/spiderpool/pkg/reservedipmanager"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/utils/pointer"
-)
-
-var _ = Describe("ReservedIPManager utils", Label("reservedip_manager_utils_test"), func() {
-	Describe("Test AssembleReservedIPs", func() {
-		var v4RIPT spiderpoolv1.SpiderReservedIP
-		var v6RIPT spiderpoolv1.SpiderReservedIP
-		var terminatingV4RIPT spiderpoolv1.SpiderReservedIP
-		var rIPListT *spiderpoolv1.SpiderReservedIPList
-
-		BeforeEach(func() {
-			ipv4 := constant.IPv4
-			ipv6 := constant.IPv6
-
-			v4RIPT = spiderpoolv1.SpiderReservedIP{
-				TypeMeta: metav1.TypeMeta{
-					Kind:       constant.SpiderReservedIPKind,
-					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
-				},
-				ObjectMeta: metav1.ObjectMeta{
-					Name: "ipv4-reservedip",
-				},
-				Spec: spiderpoolv1.ReservedIPSpec{
-					IPVersion: &ipv4,
-					IPs: []string{
-						"172.18.40.1-172.18.40.2",
-						"172.18.40.10",
-					},
-				},
-			}
-
-			v6RIPT = spiderpoolv1.SpiderReservedIP{
-				TypeMeta: metav1.TypeMeta{
-					Kind:       constant.SpiderReservedIPKind,
-					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
-				},
-				ObjectMeta: metav1.ObjectMeta{
-					Name: "ipv6-reservedip",
-				},
-				Spec: spiderpoolv1.ReservedIPSpec{
-					IPVersion: &ipv6,
-					IPs: []string{
-						"abcd:1234::1-abcd:1234::2",
-						"abcd:1234::a",
-					},
-				},
-			}
-
-			now := metav1.Now()
-			terminatingV4RIPT = spiderpoolv1.SpiderReservedIP{
-				TypeMeta: metav1.TypeMeta{
-					Kind:       constant.SpiderReservedIPKind,
-					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
-				},
-				ObjectMeta: metav1.ObjectMeta{
-					Name:                       "terminating-ipv4-reservedip",
-					DeletionTimestamp:          &now,
-					DeletionGracePeriodSeconds: pointer.Int64(30),
-				},
-				Spec: spiderpoolv1.ReservedIPSpec{
-					IPVersion: &ipv4,
-					IPs: []string{
-						"172.18.40.40",
-					},
-				},
-			}
-
-			rIPListT = &spiderpoolv1.SpiderReservedIPList{
-				TypeMeta: metav1.TypeMeta{
-					Kind:       constant.SpiderReservedIPListKind,
-					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
-				},
-				ListMeta: metav1.ListMeta{},
-				Items:    []spiderpoolv1.SpiderReservedIP{},
-			}
-		})
-
-		It("inputs invalid IP version", func() {
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.InvalidIPVersion, rIPListT)
-			Expect(err).To(MatchError(spiderpoolip.ErrInvalidIPVersion))
-			Expect(ips).To(BeEmpty())
-		})
-
-		It("inputs nil ReservedIP list", func() {
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.IPv4, nil)
-			Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
-			Expect(ips).To(BeEmpty())
-		})
-
-		It("inputs invalid IP ranges", func() {
-			v4RIPT.Spec.IPs = append(v4RIPT.Spec.IPs, constant.InvalidIPRange)
-			rIPListT.Items = append(rIPListT.Items, v4RIPT)
-
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.IPv4, rIPListT)
-			Expect(err).To(MatchError(spiderpoolip.ErrInvalidIPRangeFormat))
-			Expect(ips).To(BeEmpty())
-		})
-
-		It("does not assemble terminating IPv4 reserved-IP addresses", func() {
-			rIPListT.Items = append(rIPListT.Items, v4RIPT, terminatingV4RIPT)
-
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.IPv4, rIPListT)
-			Expect(err).NotTo(HaveOccurred())
-			Expect(ips).To(Equal(
-				[]net.IP{
-					net.IPv4(172, 18, 40, 1),
-					net.IPv4(172, 18, 40, 2),
-					net.IPv4(172, 18, 40, 10),
-				},
-			))
-		})
-
-		It("assembles IPv4 reserved-IP addresses", func() {
-			rIPListT.Items = append(rIPListT.Items, v4RIPT, v6RIPT)
-
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.IPv4, rIPListT)
-			Expect(err).NotTo(HaveOccurred())
-			Expect(ips).To(Equal(
-				[]net.IP{
-					net.IPv4(172, 18, 40, 1),
-					net.IPv4(172, 18, 40, 2),
-					net.IPv4(172, 18, 40, 10),
-				},
-			))
-		})
-
-		It("assembles IPv6 reserved-IP addresses", func() {
-			rIPListT.Items = append(rIPListT.Items, v4RIPT, v6RIPT)
-
-			ips, err := reservedipmanager.AssembleReservedIPs(constant.IPv6, rIPListT)
-			Expect(err).NotTo(HaveOccurred())
-			Expect(ips).To(Equal(
-				[]net.IP{
-					net.ParseIP("abcd:1234::1"),
-					net.ParseIP("abcd:1234::2"),
-					net.ParseIP("abcd:1234::a"),
-				},
-			))
-		})
-	})
-})
diff --git a/pkg/workloadendpointmanager/utils_test.go b/pkg/workloadendpointmanager/utils_test.go
index 4cca688f2..248117ba4 100644
--- a/pkg/workloadendpointmanager/utils_test.go
+++ b/pkg/workloadendpointmanager/utils_test.go
@@ -36,8 +36,8 @@ var _ = Describe("WorkloadEndpointManager utils", Label("workloadendpoint_manage
 
 	Describe("Test RetrieveIPAllocation", func() {
 		var nic1, nic2 string
-		var containerID, historyContainerID string
-		var allocationT, historyAllocationT *spiderpoolv1.PodIPAllocation
+		var containerID string
+		var allocationT *spiderpoolv1.PodIPAllocation
 
 		BeforeEach(func() {
 			nic1 = "eth0"
@@ -61,72 +61,30 @@ var _ = Describe("WorkloadEndpointManager utils", Label("workloadendpoint_manage
 					},
 				},
 			}
-
-			historyContainerID = stringid.GenerateRandomID()
-			historyAllocationT = &spiderpoolv1.PodIPAllocation{
-				ContainerID: historyContainerID,
-				IPs: []spiderpoolv1.IPAllocationDetail{
-					{
-						NIC:      nic1,
-						Vlan:     pointer.Int64(0),
-						IPv4:     pointer.String("172.18.40.5/24"),
-						IPv4Pool: pointer.String("ipv4-ippool-1"),
-					},
-					{
-						NIC:      nic2,
-						Vlan:     pointer.Int64(0),
-						IPv4:     pointer.String("192.168.40.6/24"),
-						IPv4Pool: pointer.String("ipv4-ippool-2"),
-					},
-				},
-			}
 		})
 
 		It("inputs nil Endpoint", func() {
-			allocation, currently := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, true, nil)
+			allocation := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, nil)
 			Expect(allocation).To(BeNil())
-			Expect(currently).To(BeFalse())
 		})
 
 		It("retrieves the IP allocation but the current record is nil", func() {
-			allocation, currently := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, true, endpointT)
+			allocation := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, endpointT)
 			Expect(allocation).To(BeNil())
-			Expect(currently).To(BeFalse())
 		})
 
 		It("retrieves non-existent current IP allocation", func() {
 			endpointT.Status.Current = allocationT
-			endpointT.Status.History = append(endpointT.Status.History, *allocationT, *historyAllocationT)
 
-			allocation, currently := workloadendpointmanager.RetrieveIPAllocation(stringid.GenerateRandomID(), nic2, true, endpointT)
+			allocation := workloadendpointmanager.RetrieveIPAllocation(stringid.GenerateRandomID(), nic2, endpointT)
 			Expect(allocation).To(BeNil())
-			Expect(currently).To(BeFalse())
 		})
 
 		It("retrieves the current IP allocation", func() {
 			endpointT.Status.Current = allocationT
-			endpointT.Status.History = append(endpointT.Status.History, *allocationT, *historyAllocationT)
 
-			allocation, currently := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, false, endpointT)
+			allocation := workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, endpointT)
 			Expect(allocation).To(Equal(allocationT))
-			Expect(currently).To(BeTrue())
-
-			allocation, currently = workloadendpointmanager.RetrieveIPAllocation(containerID, nic2, true, endpointT)
-			Expect(allocation).To(Equal(allocationT))
-			Expect(currently).To(BeTrue())
-		})
-
-		It("retrieves the historical IP allocation", func() {
-			endpointT.Status.Current = allocationT
-			endpointT.Status.History = append(endpointT.Status.History, *allocationT, *historyAllocationT)
-
-			allocation, currently := workloadendpointmanager.RetrieveIPAllocation(historyContainerID, nic2, false, endpointT)
-			Expect(allocation).To(BeNil())
-			Expect(currently).To(BeFalse())
-
-			allocation, currently = workloadendpointmanager.RetrieveIPAllocation(historyContainerID, nic2, true, endpointT)
-			Expect(allocation).To(Equal(historyAllocationT))
-			Expect(currently).To(BeFalse())
 		})
 	})
 
diff --git a/pkg/workloadendpointmanager/workloadendpoint_manager_suite_test.go b/pkg/workloadendpointmanager/workloadendpoint_manager_suite_test.go
index f157ee896..c91b8aa08 100644
--- a/pkg/workloadendpointmanager/workloadendpoint_manager_suite_test.go
+++ b/pkg/workloadendpointmanager/workloadendpoint_manager_suite_test.go
@@ -6,7 +6,6 @@ package workloadendpointmanager_test
 import (
 	"testing"
 
-	"github.com/golang/mock/gomock"
 	. "github.com/onsi/ginkgo/v2"
 	. "github.com/onsi/gomega"
 	corev1 "k8s.io/api/core/v1"
@@ -16,22 +15,14 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/client/fake"
 
 	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	podmock "github.com/spidernet-io/spiderpool/pkg/podmanager/mock"
 	"github.com/spidernet-io/spiderpool/pkg/workloadendpointmanager"
 )
 
-var mockCtrl *gomock.Controller
-var mockPodManager *podmock.MockPodManager
-
 var scheme *runtime.Scheme
 var fakeClient client.Client
 var endpointManager workloadendpointmanager.WorkloadEndpointManager
-var endpointWebhook *workloadendpointmanager.WorkloadEndpointWebhook
 
 func TestWorkloadEndpointManager(t *testing.T) {
-	mockCtrl = gomock.NewController(t)
-	defer mockCtrl.Finish()
-
 	RegisterFailHandler(Fail)
 	RunSpecs(t, "WorkloadEndpointManager Suite", Label("workloadendpointmanager", "unitest"))
 }
@@ -48,16 +39,12 @@ var _ = BeforeSuite(func() {
 		WithScheme(scheme).
 		Build()
 
-	mockPodManager = podmock.NewMockPodManager(mockCtrl)
 	endpointManager, err = workloadendpointmanager.NewWorkloadEndpointManager(
 		workloadendpointmanager.EndpointManagerConfig{
 			MaxConflictRetries: 1,
 			MaxHistoryRecords:  pointer.Int(1),
 		},
 		fakeClient,
-		mockPodManager,
 	)
 	Expect(err).NotTo(HaveOccurred())
-
-	endpointWebhook = &workloadendpointmanager.WorkloadEndpointWebhook{}
 })
diff --git a/pkg/workloadendpointmanager/workloadendpoint_manager_test.go b/pkg/workloadendpointmanager/workloadendpoint_manager_test.go
index cb0ccadef..f44851049 100644
--- a/pkg/workloadendpointmanager/workloadendpoint_manager_test.go
+++ b/pkg/workloadendpointmanager/workloadendpoint_manager_test.go
@@ -10,7 +10,6 @@ import (
 	"time"
 
 	"github.com/agiledragon/gomonkey/v2"
-	"github.com/golang/mock/gomock"
 	"github.com/moby/moby/pkg/stringid"
 	. "github.com/onsi/ginkgo/v2"
 	. "github.com/onsi/gomega"
@@ -37,7 +36,6 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 			manager, err := workloadendpointmanager.NewWorkloadEndpointManager(
 				workloadendpointmanager.EndpointManagerConfig{},
 				fakeClient,
-				mockPodManager,
 			)
 			Expect(err).NotTo(HaveOccurred())
 			Expect(manager).NotTo(BeNil())
@@ -47,17 +45,6 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 			manager, err := workloadendpointmanager.NewWorkloadEndpointManager(
 				workloadendpointmanager.EndpointManagerConfig{},
 				nil,
-				mockPodManager,
-			)
-			Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
-			Expect(manager).To(BeNil())
-		})
-
-		It("inputs nil Pod manager", func() {
-			manager, err := workloadendpointmanager.NewWorkloadEndpointManager(
-				workloadendpointmanager.EndpointManagerConfig{},
-				fakeClient,
-				nil,
 			)
 			Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
 			Expect(manager).To(BeNil())
@@ -320,118 +307,73 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 			It("inputs nil Pod", func() {
 				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), nil)
+				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), nil, spiderpooltypes.PodTopController{})
 				Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
 				Expect(endpoint).To(BeNil())
 			})
 
-			It("failed to get the top controller of Pod due to some unknown errors", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{}, constant.ErrUnknown).
-					Times(1)
-
-				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
-				Expect(err).To(MatchError(constant.ErrUnknown))
-				Expect(endpoint).To(BeNil())
-			})
-
 			It("failed to set ownerReference to Pod due to some unknown errors", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{
-						Kind:      constant.KindPod,
-						Namespace: podT.Namespace,
-						Name:      podT.Name,
-						Uid:       podT.UID,
-						App:       podT,
-					}, nil).
-					Times(1)
-
 				patches := gomonkey.ApplyFuncReturn(controllerutil.SetOwnerReference, constant.ErrUnknown)
 				defer patches.Reset()
 
 				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
+				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT, spiderpooltypes.PodTopController{})
 				Expect(err).To(MatchError(constant.ErrUnknown))
 				Expect(endpoint).To(BeNil())
 			})
 
 			It("failed to create Endpoint due to some unknown errors", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{
-						Kind:      constant.KindPod,
-						Namespace: podT.Namespace,
-						Name:      podT.Name,
-						Uid:       podT.UID,
-						App:       podT,
-					}, nil).
-					Times(1)
-
 				patches := gomonkey.ApplyMethodReturn(fakeClient, "Create", constant.ErrUnknown)
 				defer patches.Reset()
 
 				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
+				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT, spiderpooltypes.PodTopController{})
 				Expect(err).To(MatchError(constant.ErrUnknown))
 				Expect(endpoint).To(BeNil())
 			})
 
 			It("failed to update the status of Endpoint due to some unknown errors", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{
-						Kind:      constant.KindPod,
-						Namespace: podT.Namespace,
-						Name:      podT.Name,
-						Uid:       podT.UID,
-						App:       podT,
-					}, nil).
-					Times(1)
-
 				patches := gomonkey.ApplyMethodReturn(fakeClient.Status(), "Update", constant.ErrUnknown)
 				defer patches.Reset()
 
 				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
+				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT, spiderpooltypes.PodTopController{})
 				Expect(err).To(MatchError(constant.ErrUnknown))
 				Expect(endpoint).To(BeNil())
 			})
 
 			It("marks the IP allocation for orphan Pod", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{
+				ctx := context.TODO()
+				endpoint, err := endpointManager.MarkIPAllocation(
+					ctx,
+					stringid.GenerateRandomID(),
+					podT,
+					spiderpooltypes.PodTopController{
 						Kind:      constant.KindPod,
 						Namespace: podT.Namespace,
 						Name:      podT.Name,
-						Uid:       podT.UID,
-						App:       podT,
-					}, nil).
-					Times(1)
-
-				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
+						UID:       podT.UID,
+						APP:       podT,
+					},
+				)
 				Expect(err).NotTo(HaveOccurred())
 				Expect(endpoint).NotTo(BeNil())
 			})
 
 			It("marks the IP allocation for StatefulSet's Pod", func() {
-				mockPodManager.EXPECT().
-					GetPodTopController(gomock.All(), gomock.All()).
-					Return(spiderpooltypes.PodTopController{
+				ctx := context.TODO()
+				endpoint, err := endpointManager.MarkIPAllocation(
+					ctx,
+					stringid.GenerateRandomID(),
+					podT,
+					spiderpooltypes.PodTopController{
 						Kind:      constant.KindStatefulSet,
 						Namespace: namespace,
 						Name:      fmt.Sprintf("%s-sts", endpointName),
-						Uid:       uuid.NewUUID(),
-						App:       &appsv1.StatefulSet{},
-					}, nil).
-					Times(1)
-
-				ctx := context.TODO()
-				endpoint, err := endpointManager.MarkIPAllocation(ctx, stringid.GenerateRandomID(), podT)
+						UID:       uuid.NewUUID(),
+						APP:       &appsv1.StatefulSet{},
+					},
+				)
 				Expect(err).NotTo(HaveOccurred())
 				Expect(endpoint).NotTo(BeNil())
 			})
@@ -474,13 +416,13 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 			It("inputs nil Pod", func() {
 				ctx := context.TODO()
-				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), nil, endpointT)
+				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), endpointT, nil)
 				Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
 			})
 
 			It("inputs nil Endpoint", func() {
 				ctx := context.TODO()
-				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), podT, nil)
+				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), nil, podT)
 				Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
 			})
 
@@ -498,13 +440,13 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 				newPod := podT.DeepCopy()
 				newPod.SetUID(uuid.NewUUID())
-				err = endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), newPod, &endpoint)
+				err = endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), &endpoint, newPod)
 				Expect(err).To(HaveOccurred())
 			})
 
 			It("re-marks the IP allocation with the same container ID", func() {
 				ctx := context.TODO()
-				err := endpointManager.ReMarkIPAllocation(ctx, containerID, podT, endpointT)
+				err := endpointManager.ReMarkIPAllocation(ctx, containerID, endpointT, podT)
 				Expect(err).NotTo(HaveOccurred())
 			})
 
@@ -513,7 +455,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				defer patches.Reset()
 
 				ctx := context.TODO()
-				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), podT, endpointT)
+				err := endpointManager.ReMarkIPAllocation(ctx, stringid.GenerateRandomID(), endpointT, podT)
 				Expect(err).To(MatchError(constant.ErrUnknown))
 			})
 
@@ -533,7 +475,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				Expect(err).NotTo(HaveOccurred())
 
 				newContainerID := stringid.GenerateRandomID()
-				err = endpointManager.ReMarkIPAllocation(ctx, newContainerID, podT, &endpoint)
+				err = endpointManager.ReMarkIPAllocation(ctx, newContainerID, &endpoint, podT)
 				Expect(err).NotTo(HaveOccurred())
 				Expect(endpoint.Status.Current.ContainerID).To(Equal(newContainerID))
 
@@ -545,7 +487,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 		Describe("PatchIPAllocation", func() {
 			var marked *spiderpoolv1.PodIPAllocation
-			var v4Patch, v6Patch *spiderpoolv1.PodIPAllocation
+			var patch *spiderpoolv1.PodIPAllocation
 
 			BeforeEach(func() {
 				containerID := stringid.GenerateRandomID()
@@ -555,7 +497,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 					CreationTime: &metav1.Time{Time: time.Now()},
 				}
 
-				v4Patch = &spiderpoolv1.PodIPAllocation{
+				patch = &spiderpoolv1.PodIPAllocation{
 					ContainerID: containerID,
 					IPs: []spiderpoolv1.IPAllocationDetail{
 						{
@@ -564,25 +506,14 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 							IPv4:        pointer.String("172.18.40.10/24"),
 							IPv4Pool:    pointer.String("default-ipv4-ippool"),
 							IPv4Gateway: pointer.String("172.18.40.1"),
+							IPv6:        pointer.String("abcd:1234::a/120"),
+							IPv6Pool:    pointer.String("default-ipv6-ippool"),
+							IPv6Gateway: pointer.String("abcd:1234::1"),
 							Routes: []spiderpoolv1.Route{
 								{
 									Dst: "192.168.40.0/24",
 									Gw:  "172.18.40.1",
 								},
-							},
-						},
-					},
-				}
-				v6Patch = &spiderpoolv1.PodIPAllocation{
-					ContainerID: containerID,
-					IPs: []spiderpoolv1.IPAllocationDetail{
-						{
-							NIC:         "eth0",
-							Vlan:        pointer.Int64(0),
-							IPv6:        pointer.String("abcd:1234::a/120"),
-							IPv6Pool:    pointer.String("default-ipv6-ippool"),
-							IPv6Gateway: pointer.String("abcd:1234::1"),
-							Routes: []spiderpoolv1.Route{
 								{
 									Dst: "fd00:40::/120",
 									Gw:  "abcd:1234::1",
@@ -595,7 +526,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 			It("inputs nil Endpoint", func() {
 				ctx := context.TODO()
-				err := endpointManager.PatchIPAllocation(ctx, v4Patch, nil)
+				err := endpointManager.PatchIPAllocation(ctx, patch, nil)
 				Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
 			})
 
@@ -609,7 +540,7 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				endpointT.Status.Current = nil
 
 				ctx := context.TODO()
-				err := endpointManager.PatchIPAllocation(ctx, v4Patch, endpointT)
+				err := endpointManager.PatchIPAllocation(ctx, patch, endpointT)
 				Expect(err).To(HaveOccurred())
 			})
 
@@ -617,17 +548,17 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				endpointT.Status.Current = marked
 
 				ctx := context.TODO()
-				err := endpointManager.PatchIPAllocation(ctx, v4Patch, endpointT)
+				err := endpointManager.PatchIPAllocation(ctx, patch, endpointT)
 				Expect(err).To(HaveOccurred())
 			})
 
-			It("patches the IP allocation with unmatched container ID", func() {
+			It("patches the IP allocation with mismatched container ID", func() {
 				endpointT.Status.Current = marked
 				endpointT.Status.History = append(endpointT.Status.History, *marked)
-				v4Patch.ContainerID = stringid.GenerateRandomID()
+				patch.ContainerID = stringid.GenerateRandomID()
 
 				ctx := context.TODO()
-				err := endpointManager.PatchIPAllocation(ctx, v4Patch, endpointT)
+				err := endpointManager.PatchIPAllocation(ctx, patch, endpointT)
 				Expect(err).To(HaveOccurred())
 			})
 
@@ -639,11 +570,11 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				endpointT.Status.History = append(endpointT.Status.History, *marked)
 
 				ctx := context.TODO()
-				err := endpointManager.PatchIPAllocation(ctx, v4Patch, endpointT)
+				err := endpointManager.PatchIPAllocation(ctx, patch, endpointT)
 				Expect(err).To(MatchError(constant.ErrUnknown))
 			})
 
-			It("patches the IP allocation of IPv4 and IPv6", func() {
+			It("patches the IP allocation", func() {
 				endpointT.Status.Current = marked
 				endpointT.Status.History = append(endpointT.Status.History, *marked)
 
@@ -651,37 +582,13 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				err := fakeClient.Create(ctx, endpointT)
 				Expect(err).NotTo(HaveOccurred())
 
-				err = endpointManager.PatchIPAllocation(ctx, v4Patch, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-				err = endpointManager.PatchIPAllocation(ctx, v6Patch, endpointT)
+				err = endpointManager.PatchIPAllocation(ctx, patch, endpointT)
 				Expect(err).NotTo(HaveOccurred())
 
 				var endpoint spiderpoolv1.SpiderEndpoint
 				err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: endpointName}, &endpoint)
 				Expect(err).NotTo(HaveOccurred())
-				Expect(endpoint.Status.Current.IPs).To(HaveLen(1))
-				Expect(endpoint.Status.Current.IPs[0]).To(Equal(
-					spiderpoolv1.IPAllocationDetail{
-						NIC:         "eth0",
-						Vlan:        pointer.Int64(0),
-						IPv4:        pointer.String("172.18.40.10/24"),
-						IPv4Pool:    pointer.String("default-ipv4-ippool"),
-						IPv4Gateway: pointer.String("172.18.40.1"),
-						IPv6:        pointer.String("abcd:1234::a/120"),
-						IPv6Pool:    pointer.String("default-ipv6-ippool"),
-						IPv6Gateway: pointer.String("abcd:1234::1"),
-						Routes: []spiderpoolv1.Route{
-							{
-								Dst: "192.168.40.0/24",
-								Gw:  "172.18.40.1",
-							},
-							{
-								Dst: "fd00:40::/120",
-								Gw:  "abcd:1234::1",
-							},
-						},
-					},
-				))
+				Expect(endpoint.Status.Current.IPs).To(Equal(patch.IPs))
 				Expect(*endpoint.Status.Current).To(Equal(endpoint.Status.History[0]))
 			})
 		})
@@ -747,21 +654,26 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 		})
 
 		Describe("ReallocateCurrentIPAllocation", func() {
-			It("reallocates the current IP allocation for non-existent Endpoint", func() {
+			It("inputs nil Endpoint", func() {
 				ctx := context.TODO()
-				err := endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "node", namespace, endpointName)
-				Expect(apierrors.IsNotFound(err)).To(BeTrue())
+				err := endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "node", nil)
+				Expect(err).To(MatchError(constant.ErrMissingRequiredParam))
+			})
+
+			It("re-allocates but not allocate in advance", func() {
+				endpointT.Status.Current = nil
+
+				ctx := context.TODO()
+				err := endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "node", endpointT)
+				Expect(err).To(HaveOccurred())
 			})
 
-			It("reallocates the current IP allocation with the same container ID", func() {
+			It("re-allocates the current IP allocation with the same container ID", func() {
 				containerID := stringid.GenerateRandomID()
 				endpointT.Status.Current.ContainerID = containerID
 
 				ctx := context.TODO()
-				err := fakeClient.Create(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-
-				err = endpointManager.ReallocateCurrentIPAllocation(ctx, containerID, "node", namespace, endpointName)
+				err := endpointManager.ReallocateCurrentIPAllocation(ctx, containerID, "node", endpointT)
 				Expect(err).NotTo(HaveOccurred())
 			})
 
@@ -773,28 +685,10 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 				endpointT.Status.Current.Node = pointer.String("old-node")
 
 				ctx := context.TODO()
-				err := fakeClient.Create(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-
-				err = endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "new-node", namespace, endpointName)
+				err := endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "new-node", endpointT)
 				Expect(err).To(MatchError(constant.ErrUnknown))
 			})
 
-			It("runs out of retries to update the status of Endpoint, but conflicts still occur", func() {
-				patches := gomonkey.ApplyMethodReturn(fakeClient.Status(), "Update", apierrors.NewConflict(schema.GroupResource{Resource: "test"}, "other", nil))
-				defer patches.Reset()
-
-				endpointT.Status.Current.ContainerID = stringid.GenerateRandomID()
-				endpointT.Status.Current.Node = pointer.String("old-node")
-
-				ctx := context.TODO()
-				err := fakeClient.Create(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-
-				err = endpointManager.ReallocateCurrentIPAllocation(ctx, stringid.GenerateRandomID(), "new-node", namespace, endpointName)
-				Expect(err).To(MatchError(constant.ErrRetriesExhausted))
-			})
-
 			It("updates the current IP allocation", func() {
 				endpointT.Status.Current.ContainerID = stringid.GenerateRandomID()
 				endpointT.Status.Current.Node = pointer.String("old-node")
@@ -805,14 +699,11 @@ var _ = Describe("WorkloadEndpointManager", Label("workloadendpoint_manager_test
 
 				containerID := stringid.GenerateRandomID()
 				nodeName := "new-node"
-				err = endpointManager.ReallocateCurrentIPAllocation(ctx, containerID, nodeName, namespace, endpointName)
-				Expect(err).NotTo(HaveOccurred())
 
-				var endpoint spiderpoolv1.SpiderEndpoint
-				err = fakeClient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: endpointName}, &endpoint)
+				err = endpointManager.ReallocateCurrentIPAllocation(ctx, containerID, nodeName, endpointT)
 				Expect(err).NotTo(HaveOccurred())
-				Expect(endpoint.Status.Current.ContainerID).To(Equal(containerID))
-				Expect(*endpoint.Status.Current.Node).To(Equal(nodeName))
+				Expect(endpointT.Status.Current.ContainerID).To(Equal(containerID))
+				Expect(*endpointT.Status.Current.Node).To(Equal(nodeName))
 			})
 		})
 	})
diff --git a/pkg/workloadendpointmanager/workloadendpoint_webhook_test.go b/pkg/workloadendpointmanager/workloadendpoint_webhook_test.go
deleted file mode 100644
index 0d0046049..000000000
--- a/pkg/workloadendpointmanager/workloadendpoint_webhook_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2019 The Kubernetes Authors
-// SPDX-License-Identifier: Apache-2.0
-
-package workloadendpointmanager_test
-
-import (
-	"context"
-	"fmt"
-	"time"
-
-	"github.com/agiledragon/gomonkey/v2"
-	. "github.com/onsi/ginkgo/v2"
-	. "github.com/onsi/gomega"
-	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	ctrl "sigs.k8s.io/controller-runtime"
-	"sigs.k8s.io/controller-runtime/pkg/client/config"
-	"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
-	"sigs.k8s.io/controller-runtime/pkg/manager"
-
-	"github.com/spidernet-io/spiderpool/pkg/constant"
-	spiderpoolv1 "github.com/spidernet-io/spiderpool/pkg/k8s/apis/spiderpool.spidernet.io/v1"
-	"github.com/spidernet-io/spiderpool/pkg/logutils"
-	"github.com/spidernet-io/spiderpool/pkg/workloadendpointmanager"
-)
-
-var _ = Describe("WorkloadEndpointWebhook", Label("workloadendpoint_webhook_test"), func() {
-	Describe("Set up WorkloadEndpointWebhook", func() {
-		PIt("talks to a Kubernetes API server", func() {
-			cfg, err := config.GetConfig()
-			Expect(err).NotTo(HaveOccurred())
-			Expect(cfg).NotTo(BeNil())
-
-			mgr, err := ctrl.NewManager(cfg, manager.Options{Scheme: scheme})
-			Expect(err).NotTo(HaveOccurred())
-
-			err = endpointWebhook.SetupWebhookWithManager(mgr)
-			Expect(err).NotTo(HaveOccurred())
-		})
-	})
-
-	Describe("Test WorkloadEndpointWebhook's method", func() {
-		var endpointT *spiderpoolv1.SpiderEndpoint
-
-		BeforeEach(func() {
-			workloadendpointmanager.WebhookLogger = logutils.Logger.Named("Endpoint-Webhook")
-			endpointT = &spiderpoolv1.SpiderEndpoint{
-				TypeMeta: metav1.TypeMeta{
-					Kind:       constant.SpiderEndpointKind,
-					APIVersion: fmt.Sprintf("%s/%s", constant.SpiderpoolAPIGroup, constant.SpiderpoolAPIVersionV1),
-				},
-				ObjectMeta: metav1.ObjectMeta{
-					Name:      "endpoint",
-					Namespace: "default",
-				},
-			}
-		})
-
-		Describe("Default", func() {
-			It("avoids modifying the terminating Endpoint", func() {
-				deletionTimestamp := metav1.NewTime(time.Now().Add(30 * time.Second))
-				endpointT.SetDeletionTimestamp(&deletionTimestamp)
-
-				ctx := context.TODO()
-				err := endpointWebhook.Default(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-			})
-
-			It("adds finalizer", func() {
-				ctx := context.TODO()
-				err := endpointWebhook.Default(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-
-				contains := controllerutil.ContainsFinalizer(endpointT, constant.SpiderFinalizer)
-				Expect(contains).To(BeTrue())
-			})
-
-			It("failed to mutate Endpoint due to some unknown errors", func() {
-				patches := gomonkey.ApplyPrivateMethod(
-					endpointWebhook,
-					"mutateWorkloadEndpoint",
-					func(_ context.Context, _ *spiderpoolv1.SpiderEndpoint) error {
-						return constant.ErrUnknown
-					},
-				)
-				defer patches.Reset()
-
-				ctx := context.TODO()
-				err := endpointWebhook.Default(ctx, endpointT)
-				Expect(err).NotTo(HaveOccurred())
-			})
-		})
-	})
-})
diff --git a/test/e2e/common/tools.go b/test/e2e/common/tools.go
index 54bf13670..4dc38a4e1 100644
--- a/test/e2e/common/tools.go
+++ b/test/e2e/common/tools.go
@@ -22,6 +22,8 @@ import (
 	corev1 "k8s.io/api/core/v1"
 )
 
+var r = rand.New(rand.NewSource(time.Now().UnixNano()))
+
 func GenerateString(lenNum int, isHex bool) string {
 	var chars []string
 	chars = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}
@@ -30,17 +32,14 @@ func GenerateString(lenNum int, isHex bool) string {
 	}
 	str := strings.Builder{}
 	length := len(chars)
-	rand.Seed(time.Now().UnixNano())
 	for i := 0; i < lenNum; i++ {
-		str.WriteString(chars[rand.Intn(length)])
+		str.WriteString(chars[r.Intn(length)])
 	}
 	return str.String()
 }
 
 func GenerateRandomNumber(max int) string {
-	rand.Seed(time.Now().UnixNano())
-	randomNumber := rand.Intn(max)
-	return strconv.Itoa(randomNumber)
+	return strconv.Itoa(r.Intn(max))
 }
 
 func CheckPodListInclude(list *corev1.PodList, pod *corev1.Pod) bool {
@@ -115,9 +114,8 @@ func SelectIpFromIps(version types.IPVersion, ips []net.IP, ipNum int) ([]string
 	ipMap := make(map[string]bool)
 
 	length := len(ips)
-	rand.Seed(time.Now().UnixNano())
 	for i := 0; i < ipNum; i++ {
-		v := ips[rand.Intn(length)]
+		v := ips[r.Intn(length)]
 		if _, ok := ipMap[string(v)]; ok {
 			i--
 		}