mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add getStatus to CronJob
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
01164ed732
commit
87cbfd1e39
@ -66,6 +66,11 @@ export interface CronJobStatus {
|
|||||||
active?: ObjectReference[];
|
active?: ObjectReference[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum CronJobStatusPhase {
|
||||||
|
SUSPENDED = "Suspended",
|
||||||
|
SCHEDULED = "Scheduled",
|
||||||
|
}
|
||||||
|
|
||||||
export class CronJob extends KubeObject<
|
export class CronJob extends KubeObject<
|
||||||
NamespaceScopedMetadata,
|
NamespaceScopedMetadata,
|
||||||
CronJobStatus,
|
CronJobStatus,
|
||||||
@ -90,6 +95,14 @@ export class CronJob extends KubeObject<
|
|||||||
return this.spec.schedule;
|
return this.spec.schedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStatus() {
|
||||||
|
if (this.isSuspend()) {
|
||||||
|
return CronJobStatusPhase.SUSPENDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CronJobStatusPhase.SCHEDULED;
|
||||||
|
}
|
||||||
|
|
||||||
isNeverRun() {
|
isNeverRun() {
|
||||||
const schedule = this.getSchedule();
|
const schedule = this.getSchedule();
|
||||||
const daysInMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
const daysInMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user