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

Option "--selector-filter" does not work for command "service list" #152

Open
rotscher opened this issue Jul 14, 2023 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@rotscher
Copy link

The option "--selector-filter" does not work as the match is executed against labels and not against the selector field of the service:

// ServiceBySelector filters Services by Selector.
func ServiceBySelector(selector labels.Selector) FilterFunc {
	return func(s Service) bool {
                return selector.Matches(s.Labels)
	}
}
@rotscher rotscher added the bug Something isn't working label Jul 14, 2023
@rotscher rotscher self-assigned this Jul 14, 2023
@rotscher
Copy link
Author

Fix is trickier than first thought: do we fully support the label selector feature of Kubernetes (e.g. discovery service list --filter-selector="zone in (test,prod)") or is it only supported in a simple manner that means just zone=prod.

For the simple case a fix is already available (https://github.com/postfinance/discovery/tree/152-option-selector-filter-does-not-work-for-command-service-list) but this would not work for advanced selector usage.

Is the selector also a label of the service?

@rotscher
Copy link
Author

rotscher commented Aug 2, 2023

filter-selector should support the label selector feature as in Kubernetes. Selection should be possible on target labels and/or server labels. The following changes are planned:

  • filter-selector will be renamed to filter-label-selector
  • a new option filter-server-selector will be provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant