feat(controller): add label counter controller as an example#2
feat(controller): add label counter controller as an example#2liubog2008 wants to merge 7 commits intocaicloud:masterfrom liubog2008:add-controller
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. DetailsInstructions 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 DetailsNeeds 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.
please add comment to exported method
| return updated | ||
| } | ||
|
|
||
| func (lc *LabelCounterController) resolveNodeLabel(nodeLabels map[string]string) ([]*v1alpha1.LabelCounter, error) { |
| 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.
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.
Only count labels with specified prefix...
That's just an example with less meaningful logic
|
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: