@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
34 lines • 1.06 kB
JavaScript
// SPDX-License-Identifier: Apache-2.0
import { parse } from 'yaml';
import fs from 'node:fs/promises';
import { CacheArtifactEnum } from '../enums/cache-artifact-enum.js';
import { CacheTarget } from '../models/impl/cache-target.js';
/**
* YAML-backed provider for Helm chart cache targets.
*
* This provider is intended to be instantiated directly with the path to a YAML file
* containing Helm chart target definitions.
*
* Expected YAML shape:
*
* ```yaml
* charts:
* - name: cert-manager
* source: jetstack
* version: v1.17.1
* ```
*/
export class YamlHelmChartTargetProvider {
filePath;
constructor(filePath) {
this.filePath = filePath;
}
async getRequiredTargets() {
const raw = await fs.readFile(this.filePath, 'utf8');
const parsed = parse(raw);
return (parsed.charts ?? []).map((chart) => {
return new CacheTarget(CacheArtifactEnum.HELM_CHART, chart.name, chart.version, chart.source);
});
}
}
//# sourceMappingURL=yaml-helm-chart-target-provider.js.map