Skip to content

Latest commit

 

History

History
200 lines (125 loc) · 4.92 KB

api.md

File metadata and controls

200 lines (125 loc) · 4.92 KB

Table of Contents

HelmUtils

downloadChartRepo

Download the helm chart repo to a local folder.

Parameters

  • opts Object Options to use.
    • opts.srcUrl String The Uri of the chart package which should be downloaded to local disk.
    • opts.savePath String The path to download the package to. Defaults to a newly created directory in os.temp().
    • opts.saveToFile String The name of the file the package should be saved as. Defaults to index.yaml'.

Examples

Downloading with default values

const opts = {
  srcUrl: 'https://chart-repo.com/charts/chart_v1.0.0.tgz'
};
// returns a DownloadRepoResult object
let downloadRepoResult = await downloadChartRepo(opts);

Returns Promise<DownloadRepoResult, Error>

getRepoCharts

Get the chart information of a chart-repo's index.yaml file.

Parameters

  • opts Object The options for getChartVersions() function.
    • opts.src String The source to load from. This can be a local file or a Url.

Returns any ChartRepoResult

getManifestFromChart

Returns the manifest for a given chart.

Parameters

  • opts Object Options for getManifestFromChart().
    • opts.loadFromDir String The (local) directory from which the chart should be loaded from.

Examples

const opts = {
    loadFromDir: './.temp/charts/chart_v1'
}
let manifest = await getManifestFromChart();

Returns ChartManifest , to be resolved on success and rejected on failure.

getImagesFromManifest

Returns an array of all images from a given chart manifest.

Parameters

Returns Array<String> Returns an array of images found in the given manifest.

ChartRepoResult

Type: Object

Properties

  • meta Object Some meta information
  • result Object The result (content of the index.yaml file).
    • result.apiVersion string The helm's chart apiVersion property.

ChartManifest

Type: Object

DownloadRepoResult

Type: Object

Properties

  • srcUrl String The passed in srcUrl property.
  • savePath String The passed in savePath property.
  • saveToFile String The passed in saveToFile property.
  • fullPath String The full path of the downloaded file.
  • name String The filename.
  • ext String The filename's extension.

WalkInfo

Type: object

Properties

  • path string The file path.
  • name string The file basename.
  • type string Either folder or file.
  • isDir boolean Whether the current item is a directory or not.
  • extname string The file's extension.
  • object object The object in case we are dealing with a .yaml file.
  • children array<object> The children for the given item.

ResolveResult

Type: Object

Properties

  • isUrl boolean Whether the given src is an online Url or not.
  • isFile boolean Whether the given src is a local file or not.
  • is string The kind of src. Can be online, local or unknown.