-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(controller): add label counter controller as an example #2
base: master
Are you sure you want to change the base?
Conversation
@liubog2008: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing 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 |
syncHandler func(key string) error | ||
} | ||
|
||
func NewLabelCounterController(options *LabelCounterControllerOptions) *LabelCounterController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add comment to exported method
return updated | ||
} | ||
|
||
func (lc *LabelCounterController) resolveNodeLabel(nodeLabels map[string]string) ([]*v1alpha1.LabelCounter, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment to core logic
counters := []v1alpha1.Counter{} | ||
for _, v := range labelCounter.Spec.Values { | ||
selector := labels.SelectorFromSet(labels.Set{ | ||
v1alpha1.LabelPrefix + labelCounter.Name: v, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit magic?
if my crd is key:value
, the final selector is not key:value
, but prefix/key:value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only count labels with specified prefix...
That's just an example with less meaningful logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,那就把文档做细,不要让人产生误解。
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
Can we merge it now? |
i dont think we have bandwidth to review this, do you want to base ur work on this? |
Yeah, if it is not ready, I can write a demo controller for my work, it also works for me |
i don't know the status to be honest... you can see if this helps you, if not, feel free to open a new one
|
TODO: