Skip to content

Commit 840c213

Browse files
jianxiaoguoduanhongyi
authored andcommitted
fix(controller): drycc run pod should not restart
1 parent de8f9fa commit 840c213

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

rootfs/api/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ def validate_label(value):
6262
raise ValidationError("Can only contain a-z (lowercase), 0-9 and hyphens")
6363

6464

65+
def random_string(num):
66+
return ''.join(
67+
[random.choice(string.ascii_lowercase) for i in range(num)])
68+
69+
6570
def generate_app_name():
6671
"""Return a randomly-generated memorable name."""
67-
random_string = lambda num: ''.join(
68-
[random.choice(string.ascii_lowercase) for i in range(num)])
6972
return "{}-{}".format(random_string(6), random_string(8))
7073

7174

rootfs/scheduler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def run(self, namespace, name, image, entrypoint, command, **kwargs):
345345
)
346346

347347
# run pods never restart
348-
kwargs['restartPolicy'] = 'Never'
348+
kwargs['restart_policy'] = 'Never'
349349
kwargs['command'] = entrypoint
350350
kwargs['args'] = command
351351

0 commit comments

Comments
 (0)