0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-05-12 23:51:55 +00:00
renovatebot_renovate/lib/modules/manager/kustomize/common.ts
Micke Lisinge cc08c6e98f
feat(manager/kustomize): Support inflating helm charts (#34277)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-03-26 13:38:46 +00:00

25 lines
837 B
TypeScript

import semver from 'semver';
import upath from 'upath';
import type { ExtraEnv } from '../../../util/exec/types';
import { privateCacheDir } from '../../../util/fs';
import type { UpdateArtifactsConfig } from '../types';
export function generateHelmEnvs(config: UpdateArtifactsConfig): ExtraEnv {
const cacheDir = privateCacheDir();
const envs: ExtraEnv = {
// set cache and config files to a path in privateCacheDir to prevent file and credential leakage
HELM_REGISTRY_CONFIG: upath.join(cacheDir, 'registry.json'),
HELM_REPOSITORY_CONFIG: upath.join(cacheDir, 'repositories.yaml'),
HELM_REPOSITORY_CACHE: upath.join(cacheDir, 'repositories'),
};
if (
config.constraints?.helm &&
!semver.intersects(config.constraints.helm, '>=3.8.0')
) {
envs.HELM_EXPERIMENTAL_OCI = '1';
}
return envs;
}