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

feature: [yurthub] improve list/watch node pool resource in serviceTopology fil… #454

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

neo502721
Copy link
Member

…ter (#421)

What type of PR is this?

/kind feature

What this PR does / why we need it:

to improve list/watch node pool resource in serviceTopology filter

Which issue(s) this PR fixes:

Fixes #421

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add nodepool-name flag to yurthub. User can be set the nodepool-name of the yurthub's setup parameter.

other Note

if user set the yurthub parameter "--nodepool-name". That will be add LabelSelector TweakListOptions to the nodepool-informer.

@openyurt-bot openyurt-bot added the size/S size/S 10-29 label Sep 6, 2021
@neo502721
Copy link
Member Author

/assign @rambohe-ch

labelSelector = labelSelector.Add(*nodePoolLabel)
yurtSharedInformerFactory := yurtinformers.NewSharedInformerFactoryWithOptions(yurtClient, 24*time.Hour,
yurtinformers.WithTweakListOptions(func(options *metav1.ListOptions) {
options.LabelSelector = labelSelector.String()
Copy link
Member

@rambohe-ch rambohe-ch Sep 7, 2021

Choose a reason for hiding this comment

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

metadata.name is field of object, so please use FieldSelector instead LabelSelector for metadata.name, then the code like as following:

options.FieldSelector = fields.Set{"metadata.name": string(nodePoolName)}.String()

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your help. I have already modified.

@rambohe-ch
Copy link
Member

/lgtm
/approve

@openyurt-bot openyurt-bot added the lgtm lgtm label Sep 7, 2021
@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neo502721, 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 Sep 7, 2021
@openyurt-bot openyurt-bot merged commit dda64cf into openyurtio:master Sep 7, 2021
MrGirl pushed a commit to MrGirl/openyurt that referenced this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm size/S size/S 10-29
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[yurthub]improve list/watch node pool resource in serviceTopology filter.
3 participants