diff --git a/lib/manager/helm-values/__fixtures__/multi_and_nested_image_values.yaml b/lib/manager/helm-values/__fixtures__/multi_and_nested_image_values.yaml index 8a6ad738eae627473da40e327e20d0f7f63a98a3..23690cdd966d188c71a458f9966b361683cd2ff5 100644 --- a/lib/manager/helm-values/__fixtures__/multi_and_nested_image_values.yaml +++ b/lib/manager/helm-values/__fixtures__/multi_and_nested_image_values.yaml @@ -21,3 +21,9 @@ someOtherKey: some-non-image-related-key: 'with-some-value' empty_key: + +# https://github.com/bitnami/charts/blob/eae34fdbf16e2cb6a6f809d72cd22f98f6bceccc/bitnami/harbor/values.yaml#L14-L17 +coreImage: + registry: docker.io + repository: bitnami/harbor-core + tag: 2.1.3-debian-10-r38 diff --git a/lib/manager/helm-values/__snapshots__/extract.spec.ts.snap b/lib/manager/helm-values/__snapshots__/extract.spec.ts.snap index 0517bb9d715ae53f111f9ab7ed42364389c2259f..8cd4ed7c28b2b7704f31c698f6aa4b9bfcefae96 100644 --- a/lib/manager/helm-values/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/helm-values/__snapshots__/extract.spec.ts.snap @@ -27,6 +27,14 @@ Object { "replaceString": "11.5.0-debian-9-r0@sha256:4762726f1471ef048dd807afdc0e19265e95ffdcc7cb4a34891f680290022809", "versioning": "docker", }, + Object { + "currentDigest": undefined, + "currentValue": "2.1.3-debian-10-r38", + "datasource": "docker", + "depName": "docker.io/bitnami/harbor-core", + "replaceString": "2.1.3-debian-10-r38", + "versioning": "docker", + }, ], } `; diff --git a/lib/manager/helm-values/extract.spec.ts b/lib/manager/helm-values/extract.spec.ts index eb96bc4773717e7bca5eab2f7131c734e351fb7e..417c3825f5770c43d2cca2b125c80967dfd7f3fb 100644 --- a/lib/manager/helm-values/extract.spec.ts +++ b/lib/manager/helm-values/extract.spec.ts @@ -35,6 +35,7 @@ describe('lib/manager/helm-values/extract', () => { it('extracts from complex values file correctly"', () => { const result = extractPackageFile(helmMultiAndNestedImageValues); expect(result).toMatchSnapshot(); + expect(result.deps).toHaveLength(4); }); }); }); diff --git a/lib/manager/helm-values/readme.md b/lib/manager/helm-values/readme.md index 031f4bb8850ad5e6188fffb308cac4c7f380e0bd..815f1888f037bf1539d98b5b7d9e3cc480686ae6 100644 --- a/lib/manager/helm-values/readme.md +++ b/lib/manager/helm-values/readme.md @@ -1,9 +1,14 @@ Renovate supports updating of Docker dependencies within Helm Chart `values.yaml` files or other YAML files that use the same format (via `fileMatch` configuration). -Updates are performed if the files follow the conventional format used in most of the `stable` Helm charts: +Updates are performed if the files follow the conventional format used in most of the Helm charts: ```yaml image: repository: 'some-docker/dependency' tag: v1.0.0 registry: registry.example.com # optional key, will default to "docker.io" + +coreImage: + registry: docker.io + repository: bitnami/harbor-core + tag: 2.1.3-debian-10-r38 ``` diff --git a/lib/manager/helm-values/util.ts b/lib/manager/helm-values/util.ts index d886c16d00633526e3a300f9f7967794bfc3dc99..1aeabaf30b37f42813e019cd92b2a7d497ded5e3 100644 --- a/lib/manager/helm-values/util.ts +++ b/lib/manager/helm-values/util.ts @@ -6,24 +6,29 @@ export type HelmDockerImageDependency = { tag: string; }; +const parentKeyRe = /image$/i; + /** * Type guard to determine whether a given partial Helm values.yaml object potentially * defines a Helm Docker dependency. * * There is no exact standard of how Docker dependencies are defined in Helm - * values.yaml files (as of January 1st 2020), this function defines a - * heuristic based on the most commonly used format in the stable Helm charts: + * values.yaml files (as of February 26th 2021), this function defines a + * heuristic based on the most commonly used format in the Helm charts: * * image: * repository: 'something' * tag: v1.0.0 + * renovateImage: + * repository: 'something' + * tag: v1.0.0 */ export function matchesHelmValuesDockerHeuristic( parentKey: string, data: unknown ): data is HelmDockerImageDependency { return ( - parentKey === 'image' && + parentKeyRe.test(parentKey) && data && typeof data === 'object' && hasKey('repository', data) &&