From 19069cfe831c83d9f9d5622dbc20cad5bf052204 Mon Sep 17 00:00:00 2001
From: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com>
Date: Mon, 23 Nov 2020 13:48:02 -0700
Subject: [PATCH] add terminationgraceperiodseconds to job/cronjob
scaling/upgrading tab
fix args input
update container name when workload name changes in create
---
components/form/Command.vue | 17 +++++----
components/form/ShellInput.vue | 2 +-
edit/workload/Job.vue | 63 +++++++++++++++++++++++++---------
edit/workload/index.vue | 6 ++--
4 files changed, 59 insertions(+), 29 deletions(-)
diff --git a/components/form/Command.vue b/components/form/Command.vue
index d91cafd4a2..182b3f2f08 100644
--- a/components/form/Command.vue
+++ b/components/form/Command.vue
@@ -96,17 +96,16 @@ export default {
update() {
const out = {
...this.value,
- ...cleanUp({
- stdin: this.stdin,
- stdinOnce: this.stdinOnce,
- command: this.command,
- args: this.args,
- workingDir: this.workingDir,
- tty: this.tty,
- }),
+ stdin: this.stdin,
+ stdinOnce: this.stdinOnce,
+ command: this.command,
+ args: this.args,
+ workingDir: this.workingDir,
+ tty: this.tty,
+
};
- this.$emit('input', out);
+ this.$emit('input', cleanUp(out) );
},
},
};
diff --git a/components/form/ShellInput.vue b/components/form/ShellInput.vue
index e59224f5f6..169d07ba2e 100644
--- a/components/form/ShellInput.vue
+++ b/components/form/ShellInput.vue
@@ -26,7 +26,7 @@ export default {
let out = null;
if ( userValue ) {
- out = userValue.split(/ /);
+ out = userValue.match(/(\"[^\"]+\")|\S+/g).map(string => string.replace(/^"|"$/g, ''));
}
this.$emit('input', out);
diff --git a/edit/workload/Job.vue b/edit/workload/Job.vue
index b9cbdfb6ee..de5d36423b 100644
--- a/edit/workload/Job.vue
+++ b/edit/workload/Job.vue
@@ -29,7 +29,7 @@ export default {
},
data() {
const {
- failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend = false, schedule
+ failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend = false, schedule,
} = this.value;
if (this.type === WORKLOAD_TYPES.CRON_JOB) {
@@ -38,19 +38,22 @@ export default {
}
const { concurrencyPolicy = 'Allow', startingDeadlineSeconds } = this.value;
const {
- completions, parallelism, backoffLimit, activeDeadlineSeconds
+ completions, parallelism, backoffLimit, activeDeadlineSeconds,
+ template:{ spec: { terminationGracePeriodSeconds } }
+
} = this.value.jobTemplate.spec;
return {
- completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule, concurrencyPolicy, startingDeadlineSeconds
+ completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule, concurrencyPolicy, startingDeadlineSeconds, terminationGracePeriodSeconds
};
} else {
const {
- completions, parallelism, backoffLimit, activeDeadlineSeconds
+ completions, parallelism, backoffLimit, activeDeadlineSeconds,
+ template:{ spec: { terminationGracePeriodSeconds } }
} = this.value;
return {
- completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule
+ completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule, terminationGracePeriodSeconds
};
}
},
@@ -73,6 +76,8 @@ export default {
activeDeadlineSeconds: this.activeDeadlineSeconds,
};
+ spec.template.spec.terminationGracePeriodSeconds = this.terminationGracePeriodSeconds;
+
this.$emit('input', spec);
} else {
const spec = {
@@ -87,10 +92,13 @@ export default {
completions: this.completions,
parallelism: this.parallelism,
backoffLimit: this.backoffLimit,
- activeDeadlineSeconds: this.activeDeadlineSeconds
+ activeDeadlineSeconds: this.activeDeadlineSeconds,
+
}
};
+ spec.jobTemplate.spec.template.spec.terminationGracePeriodSeconds = this.terminationGracePeriodSeconds;
+
this.$emit('input', spec);
}
}
@@ -144,8 +152,9 @@ export default {
+
-