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

salt: Add label_selector support in salt kubernetes #2236

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion salt/_modules/metalk8s_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def method(manifest=None, name=None, kind=None, apiVersion=None,

# Listing resources can benefit from a simpler signature
def list_objects(kind, apiVersion, namespace='default', all_namespaces=False,
field_selector=None, **kwargs):
field_selector=None, label_selector=None, **kwargs):
"""
List all objects of a type using some object description.

Expand Down Expand Up @@ -329,6 +329,8 @@ def list_objects(kind, apiVersion, namespace='default', all_namespaces=False,
call_kwargs['namespace'] = namespace
if field_selector:
call_kwargs['field_selector'] = field_selector
if label_selector:
call_kwargs['label_selector'] = label_selector

kubeconfig, context = __salt__[
'metalk8s_kubernetes.get_kubeconfig'
Expand Down