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

Custom salt k8s module to List do not work with CustomObjects #2592

Closed
TeddyAndrieux opened this issue Jun 3, 2020 · 0 comments · Fixed by #2593
Closed

Custom salt k8s module to List do not work with CustomObjects #2592

TeddyAndrieux opened this issue Jun 3, 2020 · 0 comments · Fixed by #2593
Assignees
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed

Comments

@TeddyAndrieux
Copy link
Collaborator

Component:

'salt'

What happened:

If you try to list custom object using salt the output is wrong

[root@bootstrap /]# salt-run salt.cmd metalk8s_kubernetes.list_objects kind="PrometheusRule" apiVersion="monitoring.coreos.com/v1" namespace="metalk8s-monitoring"
- items
- kind
- apiVersion
- metadata

What was expected:

Real object output

Steps to reproduce

Resolution proposal (optional):

diff --git a/salt/_utils/kubernetes_utils.py b/salt/_utils/kubernetes_utils.py
index f7849436..ed2926a4 100644
--- a/salt/_utils/kubernetes_utils.py
+++ b/salt/_utils/kubernetes_utils.py
@@ -433,13 +433,6 @@ class CustomApiClient(ApiClient):

             result = base_method(*args, **kwargs)

-            if verb == 'list':
-                return CustomObject({
-                    'kind': '{}List'.format(self.kind),
-                    'apiVersion': '{s.group}/{s.version}'.format(s=self),
-                    'items': [CustomObject(obj) for obj in result],
-                })
-
             # TODO: do we have a result for `delete` methods?
             return CustomObject(result)
@TeddyAndrieux TeddyAndrieux added kind:bug Something isn't working complexity:easy Something that requires less than a day to fix priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed labels Jun 3, 2020
@TeddyAndrieux TeddyAndrieux added this to the MetalK8s 2.4.4 milestone Jun 3, 2020
@TeddyAndrieux TeddyAndrieux self-assigned this Jun 3, 2020
bert-e added a commit that referenced this issue Jun 3, 2020
…tmp/octopus/w/2.6/bugfix/GH-2592-fix-list-custom-object-salt
bert-e added a commit that referenced this issue Jun 4, 2020
bert-e added a commit that referenced this issue Jun 4, 2020
…tmp/octopus/w/2.2/bugfix/GH-2592-fix-list-custom-object-salt
bert-e added a commit that referenced this issue Jun 4, 2020
…tmp/octopus/w/2.3/bugfix/GH-2592-fix-list-custom-object-salt
bert-e added a commit that referenced this issue Jun 4, 2020
…tmp/octopus/w/2.4/bugfix/GH-2592-fix-list-custom-object-salt
bert-e added a commit that referenced this issue Jun 4, 2020
…tmp/octopus/w/2.5/bugfix/GH-2592-fix-list-custom-object-salt
@bert-e bert-e closed this as completed in 1b010b1 Jun 4, 2020
Ebaneck added a commit that referenced this issue Jun 7, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Ebaneck added a commit that referenced this issue Jun 8, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Ebaneck added a commit that referenced this issue Jun 8, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Ebaneck added a commit that referenced this issue Jun 8, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Ebaneck added a commit that referenced this issue Jun 8, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Ebaneck added a commit that referenced this issue Jun 8, 2020
The Metalk8s python-kubernetes module list_objects method
is bugged for already released versions as reported
here:#2592.

The module has been patched in this PR: #2592
but since we require the list_objects methods to cleanup old
PrometheusRule, we need to find a way to skip cleanup for
already released versions.

Closes: #2606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working priority:high High priority issues, should be worked on ASAP (after urgent issues), not postponed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant