From 5e7c36d2a1d9f0c25cb5143ea38d246c96d1c595 Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Wed, 17 Oct 2018 14:47:16 -0500 Subject: [PATCH] Avoid bug in tiller when both sorting and paging releases The tiller list releases command has a bug when using sorting and paging simultaneously. Armada was passing sorting parameters, but it doesn't really care about the order, so this removes the sorting parameters to avoid the tiller issue. Change-Id: If8349a8093d4b79d5e056d988b710372705eb669 --- armada/handlers/tiller.py | 4 +--- armada/tests/unit/handlers/test_tiller.py | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/armada/handlers/tiller.py b/armada/handlers/tiller.py index 407383e4..75db317d 100644 --- a/armada/handlers/tiller.py +++ b/armada/handlers/tiller.py @@ -202,9 +202,7 @@ class Tiller(object): req = ListReleasesRequest( offset=next_release_expected, limit=LIST_RELEASES_PAGE_SIZE, - status_codes=[const.STATUS_DEPLOYED, const.STATUS_FAILED], - sort_by='LAST_RELEASED', - sort_order='DESC') + status_codes=[const.STATUS_DEPLOYED, const.STATUS_FAILED]) LOG.debug('Tiller ListReleases() with timeout=%s, request=%s', self.timeout, req) diff --git a/armada/tests/unit/handlers/test_tiller.py b/armada/tests/unit/handlers/test_tiller.py index edbbf683..5671dcd1 100644 --- a/armada/tests/unit/handlers/test_tiller.py +++ b/armada/tests/unit/handlers/test_tiller.py @@ -203,9 +203,7 @@ class TillerTestCase(base.ArmadaTestCase): limit=tiller.LIST_RELEASES_PAGE_SIZE, status_codes=[ tiller.const.STATUS_DEPLOYED, tiller.const.STATUS_FAILED - ], - sort_by='LAST_RELEASED', - sort_order='DESC') + ]) @mock.patch('armada.handlers.tiller.K8s') @mock.patch('armada.handlers.tiller.grpc') @@ -255,9 +253,7 @@ class TillerTestCase(base.ArmadaTestCase): limit=tiller.LIST_RELEASES_PAGE_SIZE, status_codes=[ tiller.const.STATUS_DEPLOYED, tiller.const.STATUS_FAILED - ], - sort_by='LAST_RELEASED', - sort_order='DESC') for i in range(page_count) + ]) for i in range(page_count) ] mock_list_releases_request.assert_has_calls(list_release_request_calls)