CachedHelmInventory

class neophile.inventory.helm.CachedHelmInventory(session: ClientSession, cache_path: Path)

Bases: neophile.inventory.helm.HelmInventory

Cache the inventory of versions from a Helm repository.

Currently this does not protect against multiple versions of neophile runnign simultaneously. This can be added later.

Parameters:session (aiohttp.ClientSession) – The aiohttp client session to use to make requests for Helm repository index files.

Methods Summary

inventory(url) Inventory the available versions of Helm charts.

Methods Documentation

inventory(url: str) → Dict[str, str]

Inventory the available versions of Helm charts.

Retrieve the inventory from the given Helm repository.

Parameters:

url (str) – URL of the repository.

Returns:

results – Returns a dict of Helm chart names to the latest available version of that Helm chart.

Return type:

Dict[str, str]

Raises:
  • aiohttp.ClientError – Failure to retrieve the index file from the Helm repository.
  • yaml.YAMLError – The index file for the repository doesn’t parse as YAML.

Notes

This makes a copy of the contents of the cache to prevent the caller from mutating the cache unexpectedly.