Add cronjob trigger (#694)

Signed-off-by: Nox <aurelien.gaston@krondor.fr>

Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
NoxandLauri Nevala authored and GitHub committed 2020-08-25 10:55:12 +03:00
1 parent 0f11b03692
commit 8f778ea379
12 files changed
+259 -37

No files matched your search

+8 -1
View File
@@ -32,6 +32,12 @@ export class CronJob extends KubeObject {
jobTemplate: {
metadata: {
creationTimestamp?: string;
labels?: {
[key: string]: string;
};
annotations?: {
[key: string]: string;
};
};
spec: {
template: {
@@ -53,7 +59,7 @@ export class CronJob extends KubeObject {
failedJobsHistoryLimit: number;
}
status: {
lastScheduleTime: string;
lastScheduleTime?: string;
}
getSuspendFlag() {
@@ -61,6 +67,7 @@ export class CronJob extends KubeObject {
}
getLastScheduleTime() {
if (!this.status.lastScheduleTime) return "-"
const diff = moment().diff(this.status.lastScheduleTime)
return formatDuration(diff, true)
}
+7 -4
View File
@@ -13,7 +13,7 @@ export class Job extends WorkloadKubeObject {
parallelism?: number;
completions?: number;
backoffLimit?: number;
selector: {
selector?: {
matchLabels: {
[name: string]: string;
};
@@ -21,8 +21,11 @@ export class Job extends WorkloadKubeObject {
template: {
metadata: {
creationTimestamp?: string;
labels: {
name: string;
labels?: {
[name: string]: string;
};
annotations?: {
[name: string]: string;
};
};
spec: {
@@ -35,7 +38,7 @@ export class Job extends WorkloadKubeObject {
nodeSelector?: {
[selector: string]: string;
};
tolerations: {
tolerations?: {
key: string;
operator: string;
effect: string;