UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

32 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toContainerPort = toContainerPort; exports.toContainerPorts = toContainerPorts; exports.toServicePort = toServicePort; exports.toServicePorts = toServicePorts; const sample_interfaces_1 = require("@k8ts/sample-interfaces"); const doddle_1 = require("doddle"); function toContainerPort(entry) { return { containerPort: entry.port, name: entry.name, protocol: entry.protocol, hostPort: entry.hostPort, hostIp: entry.hostIp?.text }; } function toContainerPorts(ports) { return (0, doddle_1.seq)(ports.values.values()).map(toContainerPort).toArray().pull(); } function toServicePort(entry) { return { port: entry.frontend, targetPort: sample_interfaces_1.CDK.IntOrString.fromString(entry.name), protocol: entry.protocol, name: entry.name }; } function toServicePorts(ports) { return (0, doddle_1.seq)(ports.values.values()).map(toServicePort).toArray().pull(); } //# sourceMappingURL=adapters.js.map