Skip to content

check whether pods should be managed when ns is managed#958

Merged
kmesh-bot merged 1 commit intokmesh-net:mainfrom
YaoZengzeng:manage
Oct 15, 2024
Merged

check whether pods should be managed when ns is managed#958
kmesh-bot merged 1 commit intokmesh-net:mainfrom
YaoZengzeng:manage

Conversation

@YaoZengzeng
Copy link
Copy Markdown
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #956

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Oct 15, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 54.58%. Comparing base (739fde5) to head (f2dbc07).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/manage/manage_controller.go 81.81% 2 Missing ⚠️
Files with missing lines Coverage Δ
pkg/utils/enroll.go 94.64% <100.00%> (+0.19%) ⬆️
pkg/controller/manage/manage_controller.go 56.57% <81.81%> (+1.51%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b85ca41...f2dbc07. Read the comment docs.

if !utils.ShouldEnroll(nil, oldNS) && utils.ShouldEnroll(nil, newNS) {
log.Infof("Enabling Kmesh for all pods in namespace: %s", newNS.Name)
kmc.enableKmeshForPodsInNamespace(newNS.Name)
kmc.enableKmeshForPodsInNamespace(newNS)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When there is no manage label on the ns and there is a manage label on the pod, this pod will be managed by Kmesh. So when there is no manage label on the pod but there is a manag label on the ns, will the pod be managed in this case?
Would this be a scenario where something goes wrong and should we report an error?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the ns is managed by Kmesh, the pods with no manage label or with label of "istio.io/dataplane-mode: Kmesh" should be managed. But if the label of pods is "istio.io/dataplane-mode: none", they should not be managed.

@LiZhenCheng9527
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiZhenCheng9527

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 684ce89 into kmesh-net:main Oct 15, 2024

for _, pod := range pods {
kmc.enableKmeshManage(pod)
if utils.ShouldEnroll(pod, namespace) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is redundant, namespace already enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check whether pods should be managed when ns is managed

4 participants