mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
0f11b03692
commit
8f778ea379
12 files changed
+259
-37
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user