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

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

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

YaoZengzeng
Copy link
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
Copy link

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.

@@ -209,12 +209,12 @@ func (kmc *KmeshManageController) handleNamespaceUpdateFunc(oldObj, newObj inter
// Compare labels to check if they have actually changed
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
Collaborator

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
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
Collaborator

/lgtm
/approve

@kmesh-bot
Copy link
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

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
9 checks passed
return
}

for _, pod := range pods {
kmc.enableKmeshManage(pod)
if utils.ShouldEnroll(pod, namespace) {
Copy link
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