mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 18:19:51 +00:00
be13c9f5f7
* feat(manager): share OCI Helm chart resolution across managers Add getOciChartDep() to helmv3/oci.ts and use it in argocd, fleet, flux, helmfile, helmsman, helmv3, kustomize, sveltos, terraform and vendir. - set pinDigests: false for OCI charts in all of them - apply registryAliases to OCI charts in argocd, helmfile and helmsman - keep the registry port in terraform helm_release repositories - skip fleet OCI charts without a version instead of using 'undefined' * docs(manager/helmv3): correct the OCI chart pinDigests rationale * refactor(manager/helmfile): drop redundant OCI repository url guard The repository schema already requires url to be a string, so the falsy branch could not be reached by parsed input and left the patch partially covered.
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { getOciChartDep } from './oci.ts';
|
|
|
|
describe('modules/manager/helmv3/oci', () => {
|
|
describe('getOciChartDep()', () => {
|
|
it('resolves a chart in an OCI repository', () => {
|
|
expect(getOciChartDep('oci://ghcr.io/charts', 'foo')).toEqual({
|
|
datasource: 'docker',
|
|
packageName: 'ghcr.io/charts/foo',
|
|
pinDigests: false,
|
|
});
|
|
});
|
|
|
|
it('resolves a repository which already contains the chart', () => {
|
|
expect(getOciChartDep('oci://ghcr.io/charts/foo')).toEqual({
|
|
datasource: 'docker',
|
|
packageName: 'ghcr.io/charts/foo',
|
|
pinDigests: false,
|
|
});
|
|
});
|
|
|
|
it('ignores a trailing slash and a missing oci prefix', () => {
|
|
expect(getOciChartDep('ghcr.io/charts/', 'foo')).toMatchObject({
|
|
packageName: 'ghcr.io/charts/foo',
|
|
});
|
|
});
|
|
|
|
it('keeps the registry port', () => {
|
|
expect(
|
|
getOciChartDep('oci://registry.example.com:5000/charts', 'foo'),
|
|
).toMatchObject({
|
|
packageName: 'registry.example.com:5000/charts/foo',
|
|
});
|
|
});
|
|
|
|
it('applies registryAliases', () => {
|
|
expect(
|
|
getOciChartDep('oci://registry.example.com/charts', 'foo', {
|
|
'registry.example.com': 'registry-1.docker.io',
|
|
}),
|
|
).toMatchObject({
|
|
packageName: 'registry-1.docker.io/charts/foo',
|
|
});
|
|
});
|
|
|
|
it('skips references containing variables', () => {
|
|
expect(getOciChartDep('oci://$REGISTRY/charts', 'foo')).toEqual({
|
|
datasource: 'docker',
|
|
packageName: undefined,
|
|
skipReason: 'contains-variable',
|
|
pinDigests: false,
|
|
});
|
|
});
|
|
});
|
|
});
|