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 conflicts for getting node by local storage in yurthub filters #1552

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

rambohe-ch
Copy link
Member

@rambohe-ch rambohe-ch commented Jun 18, 2023

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

  1. As described in pull request optimize yurthub kubelet node cache operator #1461 , filter servicetoplogy and nodeisolation have conflicts for getting node from local storage, and filter can not work well.

  2. After diving into the code of these two filters, we found that node resource is used for resolving node pool, and as discussed in the issue: [feature request]can not move node to another nodepool by label modification #1382 and pull request feat: prevent node movement by label modification #1444 , node pool name for a node can not be changed after joining into the cluster.

  3. at the same time, node pool name can be passed into yurthub by yurtadm join command, the detail info can be found in the pull request: add yurtadm join node in specified nodepool #1402 , so we just use node pool name or get node from kube-apiserver only once when node pool name is not passed by yurtadm join. then we can remove all the codes of getting node from local storage, and solve the conflicts problem.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@rambohe-ch: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

What this PR does / why we need it:

  1. As described in pull request #1461 , filter servicetoplogy and nodeisolation have conflicts for getting node from local storage, and filter can not work well.

  2. After diving into the code of these two filters, we found that node resource is used for resolving node pool, and as discussed in the issue: [feature request]can not move node to another nodepool by label modification #1382 and pull request feat: prevent node movement by label modification #1444 , node pool name for a node can not be changed after joining into the cluster.

  3. at the same time, node pool name can be passed into yurthub by yurtadm join command, the detail info can be found in the pull request: add yurtadm join node in specified nodepool #1402 , so we just use node pool name or get node from kube-apiserver only once when node pool name is not passed by yurtadm join. then we can remove all the codes of getting node from local storage, and solve the conflicts problem.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot openyurt-bot added the size/XL size/XL: 500-999 label Jun 18, 2023
@rambohe-ch rambohe-ch added the kind/bug kind/bug label Jun 18, 2023
@rambohe-ch
Copy link
Member Author

@JameKeal @YTGhost PTAL

@codecov
Copy link

codecov bot commented Jun 18, 2023

Codecov Report

Merging #1552 (1ef7e11) into master (c3cf90b) will increase coverage by 0.38%.
The diff coverage is 55.00%.

@@            Coverage Diff             @@
##           master    #1552      +/-   ##
==========================================
+ Coverage   50.85%   51.23%   +0.38%     
==========================================
  Files         133      133              
  Lines       15852    15740     -112     
==========================================
+ Hits         8062     8065       +3     
+ Misses       7045     6936     -109     
+ Partials      745      739       -6     
Flag Coverage Δ
unittests 51.23% <55.00%> (+0.38%) ⬆️

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

Impacted Files Coverage Δ
pkg/yurthub/filter/filter.go 55.43% <0.00%> (+0.88%) ⬆️
pkg/yurthub/filter/servicetopology/filter.go 72.14% <42.10%> (+15.84%) ⬆️
pkg/yurthub/filter/nodeportisolation/filter.go 85.71% <73.33%> (+25.85%) ⬆️
cmd/yurthub/app/config/config.go 53.61% <100.00%> (ø)
pkg/yurthub/filter/manager/manager.go 85.48% <100.00%> (+16.12%) ⬆️

@sonarcloud
Copy link

sonarcloud bot commented Jun 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.0% 2.0% Duplication

Copy link
Member

@YTGhost YTGhost left a comment

Choose a reason for hiding this comment

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

/lgtm

@JameKeal
Copy link
Member

/lgtm

@openyurt-bot
Copy link
Collaborator

@JameKeal: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kadisi
Copy link
Member

kadisi commented Jun 19, 2023

/lgtm

1 similar comment
@kadisi
Copy link
Member

kadisi commented Jun 19, 2023

/lgtm

@kadisi
Copy link
Member

kadisi commented Jun 19, 2023

/approve

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadisi, rambohe-ch

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

@openyurt-bot openyurt-bot added the approved approved label Jun 19, 2023
@openyurt-bot openyurt-bot merged commit 669e004 into openyurtio:master Jun 19, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved kind/bug kind/bug lgtm lgtm size/XL size/XL: 500-999
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants