Skip to content

Commit 542481e

Browse files
authored
Merge pull request teamhephy#52 from jianxiaoguo/main
chore(test): pretty pods list print
2 parents 2ee14b3 + d788743 commit 542481e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

charts/controller/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ image_tag: "canary"
44
image_registry: "docker.io"
55
app_image_pull_policy: "Always"
66
# A comma-separated list of URLs to send app release information to
7-
# See https://drycc.com/docs/workflow/managing-workflow/deploy-hooks
7+
# See https://www.drycc.cc/managing-workflow/deploy-hooks/
88
deploy_hook_urls: ""
99
# limits_cpu: "100m"
1010
# limits_memory: "50Mi"

rootfs/api/tests/test_pods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test_release(self, mock_requests):
263263
url = "/v2/apps/{app_id}/pods".format(**locals())
264264
response = self.client.get(url)
265265
self.assertEqual(response.status_code, 200, response.data)
266-
self.assertEqual(len(response.data['results']), 2)
266+
self.assertEqual(len(response.data['results']), 1)
267267
self.assertEqual(response.data['results'][0]['release'], 'v3')
268268

269269
# post new config
@@ -275,7 +275,7 @@ def test_release(self, mock_requests):
275275
url = "/v2/apps/{app_id}/pods".format(**locals())
276276
response = self.client.get(url)
277277
self.assertEqual(response.status_code, 200, response.data)
278-
self.assertEqual(len(response.data['results']), 2)
278+
self.assertEqual(len(response.data['results']), 1)
279279
self.assertEqual(response.data['results'][0]['release'], 'v4')
280280

281281
def test_container_errors(self, mock_requests):

rootfs/api/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ def list(self, *args, **kwargs):
353353
structure = self.get_app().structure
354354
procfile_structure = self.get_app().procfile_structure
355355
# remove prev release container type
356-
structure = {k: v for k, v in structure.items() if (v != 0 or k in procfile_structure)} # noqa
356+
if procfile_structure:
357+
condition_procfile_structure = list(procfile_structure.keys())
358+
else:
359+
condition_procfile_structure = ['cmd', 'web']
360+
structure = {k: v for k, v in structure.items() if (v != 0 or k in condition_procfile_structure)} # noqa
357361
for _ in structure.keys():
358362
if _ not in exist_pod_type:
359363
replicas = str(autoscale[_]['min']) + '-' + str(autoscale[_]['max']) \

0 commit comments

Comments
 (0)