UNPKG

@apigeeks/fbl-k8s-plugin

Version:

fbl wrapper plugin for helm and kubectl cli utilities

50 lines 2.15 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const Joi = require("joi"); const typedi_1 = require("typedi"); const fbl_1 = require("fbl"); const services_1 = require("../../services"); class K8sHelmUpgradeOrInstallActionHandler extends fbl_1.ActionHandler { /* istanbul ignore next */ getMetadata() { return K8sHelmUpgradeOrInstallActionHandler.metadata; } getValidationSchema() { return K8sHelmUpgradeOrInstallActionHandler.schema; } execute(options, context, snapshot, parameters) { return __awaiter(this, void 0, void 0, function* () { yield typedi_1.Container.get(services_1.K8sHelmService).updateOrInstall(options, snapshot.wd, context); }); } } K8sHelmUpgradeOrInstallActionHandler.metadata = { id: 'a6s.k8s.helm.upgradeOrInstall', aliases: ['k8s.helm.upgradeOrInstall', 'helm.upgradeOrInstall', 'helm.install'], }; K8sHelmUpgradeOrInstallActionHandler.schema = Joi.object({ name: Joi.string(), namespace: Joi.string(), tillerNamespace: Joi.string(), chart: Joi.string().required(), version: Joi.string(), variables: Joi.object({ inline: Joi.any(), files: Joi.array().items(Joi.string()), }), wait: Joi.boolean(), timeout: Joi.number() .integer() .min(0) .max(60 * 60), }).options({ abortEarly: true }); exports.K8sHelmUpgradeOrInstallActionHandler = K8sHelmUpgradeOrInstallActionHandler; //# sourceMappingURL=K8sHelmUpgradeOrInstallActionHandler.js.map