UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

37 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CronJob = void 0; const instruments_1 = require("@k8ts/instruments"); const doddle_1 = require("doddle"); const lodash_1 = require("lodash"); const batch_1 = require("../../kinds/batch"); const pod_1 = require("../pod"); class CronJob extends instruments_1.Resource_Top { get kind() { return batch_1.batch.v1.CronJob._; } _template = (0, doddle_1.doddle)(() => { return new pod_1.Pod_Template(this, this.name, this.props.$template); }); __kids__() { return [this._template.pull()]; } body() { const self = this; const template = self._template.pull()["__submanifest__"](); return { spec: { ...(0, lodash_1.omitBy)(self.props, (x, k) => k.startsWith("$") || k === "timeZone"), schedule: self.props.$schedule.toString(), timeZone: self.props.timeZone, jobTemplate: { spec: { template: template } } } }; } } exports.CronJob = CronJob; //# sourceMappingURL=index.js.map