Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pod not-ready causes webhook call failure #4280

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

ty-dc
Copy link
Collaborator

@ty-dc ty-dc commented Nov 11, 2024

Thanks for contributing!

Notice:

What issue(s) does this PR fix:

Fixes #4277

Special notes for your reviewer:

  1. 在重启工作节点后,新的 Pod 必须先运行,才会终结旧的 spiderpool-controller Pod,而由于端口占用的问题,新的 spiderpool-controller pod 永远不会 running,一直都是 Pending 的。故将 spiderpool-controller deploy 的 maxSurge 设置为 0 后,让 Pod 先终结在运行新的 spiderpool-controller Pod 。但是它会依次重启每一个副本 Pod,在用例原本逻辑中,只检查了 worker 节点上的 Pod webhook 。导致有概率出现 control-plane 上的 Pod 还没有 1/1,而是 0/1。影响其他 case 创建 Pod。

  2. 优化 deferCleanup 和 BeforeEach,将一些代码顺序变更。

@ty-dc ty-dc added release/none no release note cherrypick-release-v1.0 Cherry-pick the PR to branch release-v1.0. labels Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.60%. Comparing base (364fb54) to head (e1d6c17).
Report is 34 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4280      +/-   ##
==========================================
+ Coverage   79.55%   79.60%   +0.04%     
==========================================
  Files          53       53              
  Lines        6252     6252              
==========================================
+ Hits         4974     4977       +3     
+ Misses       1085     1083       -2     
+ Partials      193      192       -1     
Flag Coverage Δ
unittests 79.60% <ø> (+0.04%) ⬆️

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

see 1 file with indirect coverage changes

@ty-dc ty-dc requested a review from cyclinder November 28, 2024 07:12
@ty-dc ty-dc merged commit 3b9d8f6 into spidernet-io:main Nov 28, 2024
54 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 28, 2024
fix: pod not-ready causes webhook call failure
Signed-off-by: robot <[email protected]>
Copy link
Collaborator

@cyclinder cyclinder left a comment

Choose a reason for hiding this comment

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

PR 标题说明是 e2e 的 修复,否则会认为是业务代码修复

if err != nil {
return err
}
} else if !podutils.IsPodReady(&newPod) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

不需要额外的 else , 直接都 return了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick-release-v1.0 Cherry-pick the PR to branch release-v1.0. release/none no release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nightly K8s Matrix CI 2024-11-09: Failed
4 participants