Skip to content

fix(manager/kustomize): prevent setting replaceString for OCI chart extraction with registry aliases - #39346

Merged
viceice merged 2 commits into
renovatebot:mainfrom
tiagodcc:fix/kustomize-oci-helm-charts
Nov 18, 2025
Merged

fix(manager/kustomize): prevent setting replaceString for OCI chart extraction with registry aliases#39346
viceice merged 2 commits into
renovatebot:mainfrom
tiagodcc:fix/kustomize-oci-helm-charts

Conversation

@tiagodcc

Copy link
Copy Markdown
Contributor

Changes

When using the kustomize manager, Helm charts may be referenced using OCI registries. However, if registry aliases are used, replaceString is set by the dockerfile manager, leading to a failure while replacing the version key of the existing context. In this PR, the object key replaceString is deleted using a destruction.

The issue has already been described in the following discussion: #37638

Context

Please select one of the following:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository:

@CLAassistant

CLAassistant commented Nov 17, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tiagodcc
tiagodcc force-pushed the fix/kustomize-oci-helm-charts branch from f37c22b to b4f57ce Compare November 17, 2025 13:01
@tiagodcc

Copy link
Copy Markdown
Contributor Author

I had to force push to correct the author information of the commit.

This change only addresses the issue in the kustomize manager. However, I suspect a more central fix might be appropriate in the dockerfile manager, specifically here: https://github.com/renovatebot/renovate/blob/main/lib/modules/manager/dockerfile/extract.ts#L186

It appears the specifyReplaceString parameter is being ignored in that logic. I was hesitant to make the change there as I wasn't completely sure about potential side effects for other managers.

What are your thoughts? If you agree the dockerfile manager is the better approach, I'm happy to update this PR.

@tiagodcc tiagodcc changed the title fix: Prevent setting replaceString for OCI chart extraction with aliases fix(manager/kustomize): prevent setting replaceString for OCI chart extraction with registry aliases Nov 17, 2025
@RahulGautamSingh

Copy link
Copy Markdown
Collaborator

I get the issue, but this does not seems to be the correct solution. Can you please create a minimal reproduction so we can discuss the best solution?

@tiagodcc

Copy link
Copy Markdown
Contributor Author

Thanks for your fast reply! I created a minimal reproduction here: https://github.com/tiagodcc/kustomize-oci-helm

Comment thread lib/modules/manager/kustomize/extract.ts Outdated
Comment thread lib/modules/manager/kustomize/extract.ts Outdated
@tiagodcc
tiagodcc requested a review from viceice November 18, 2025 13:37
@viceice
viceice added this pull request to the merge queue Nov 18, 2025
Merged via the queue into renovatebot:main with commit aa9416a Nov 18, 2025
38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 42.14.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants