Skip to content

[main] fix(kustomize): ensures compatibility with v5#366

Merged
openshift-merge-bot[bot] merged 1 commit intoopendatahub-io:mainfrom
openshift-cherrypick-robot:cherry-pick-365-to-main
Aug 7, 2025
Merged

[main] fix(kustomize): ensures compatibility with v5#366
openshift-merge-bot[bot] merged 1 commit intoopendatahub-io:mainfrom
openshift-cherrypick-robot:cherry-pick-365-to-main

Conversation

@openshift-cherrypick-robot
Copy link

@openshift-cherrypick-robot openshift-cherrypick-robot commented Aug 7, 2025

This is an automated cherry-pick of #365

/assign spolti

Summary by CodeRabbit

  • Refactor

    • Reformatted and updated configuration files for improved consistency and structure.
    • Renamed and reorganized label and patch sections for clarity.
    • Removed unnecessary fields and attributes from configuration files.
  • Chores

    • Cleaned up resource references and configuration options in overlay files.

Signed-off-by: Bartosz Majsak <bartosz.majsak@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2025

Walkthrough

This change updates several Kustomize YAML configuration files under the config/overlays/odh directory. It removes all content from the default/kustomization.yaml file, modifies params.yaml files by adjusting or removing fields, and refactors the main kustomization.yaml for formatting consistency and key renaming without altering resource semantics.

Changes

Cohort / File(s) Change Summary
Remove all content from default kustomization
config/overlays/odh/default/kustomization.yaml
All resource references, generators, transformers, configurations, and patches were removed, leaving only the apiVersion and kind headers.
Adjust varReference and remove apiVersion in default params
config/overlays/odh/default/params.yaml
The varReference path was changed by removing the array index notation, and the apiVersion field was deleted. No changes to exported/public entities.
YAML formatting and key renaming in main kustomization
config/overlays/odh/kustomization.yaml
Reformatted lists and indentation for consistency; renamed patchesStrategicMerge to patches; replaced commonLabels with a labels section; all changes are syntactic and structural, with no semantic impact on resources or variables.
Remove apiVersion and apiGroup in main params
config/overlays/odh/params.yaml
Removed the apiVersion field from ServiceAccount and Deployment entries and the apiGroup field from ClusterRoleBinding and RoleBinding entries in the varReference list. Structure otherwise unchanged.

Sequence Diagram(s)

No sequence diagram generated due to the nature of the configuration and formatting changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit hops through YAML fields,
Tidying lines as the config yields.
Labels and lists now neat and spry,
Old headers trimmed, no need to cry.
With patches renamed and arrays in place,
The overlays now show a cleaner face!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@spolti spolti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Aug 7, 2025
@openshift-ci
Copy link

openshift-ci bot commented Aug 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, spolti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Aug 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
config/overlays/odh/kustomization.yaml (1)

19-21: Consider declaring patch type explicitly

patches: defaults to strategic merge, but v5 also supports json and merge types.
Add type: strategic for future-proof clarity and to avoid behaviour changes if defaults evolve.

 patches:
-  - path: ./crd/clusterservingruntime_patch_delete.yaml
+  - path: ./crd/clusterservingruntime_patch_delete.yaml
+    type: strategic
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a543e2c and 547b436.

📒 Files selected for processing (4)
  • config/overlays/odh/default/kustomization.yaml (0 hunks)
  • config/overlays/odh/default/params.yaml (1 hunks)
  • config/overlays/odh/kustomization.yaml (1 hunks)
  • config/overlays/odh/params.yaml (0 hunks)
💤 Files with no reviewable changes (2)
  • config/overlays/odh/params.yaml
  • config/overlays/odh/default/kustomization.yaml
🔇 Additional comments (3)
config/overlays/odh/default/params.yaml (1)

2-3: Verify updated array-field path – containers/image may not match all containers

varReference previously used containers[]/image, which explicitly targets every element in the list.
With the brackets removed the path now resolves to the first item only (per kustomize path semantics). That can silently miss image substitutions for additional containers.

Please double-check against real manifests (or run kustomize build) to ensure the variable still expands for every container, and, if needed, switch to the recommended replacement mechanism in v5 (replacements: with a source/targets block).

config/overlays/odh/kustomization.yaml (2)

5-9: Resource list re-format looks fine

Pure indentation / dash-style change – no semantic impact detected.


64-69: New labels: section – good upgrade

Switching from commonLabels to labels: with includeSelectors: true aligns with the v5 API and preserves selector labelling. Nice catch.

Comment on lines +23 to +57
- fieldref:
fieldPath: metadata.namespace
name: mesh-namespace
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
- fieldref:
fieldPath: data.odh-modelmesh
name: odh-modelmesh
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
- fieldref:
fieldPath: data.odh-mm-rest-proxy
name: odh-mm-rest-proxy
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
- fieldref:
fieldPath: data.odh-modelmesh-runtime-adapter
name: odh-modelmesh-runtime-adapter
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
- fieldref:
fieldPath: data.odh-modelmesh-controller
name: odh-modelmesh-controller
objref:
apiVersion: v1
kind: ConfigMap
name: mesh-parameters
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

vars: feature is formally deprecated in Kustomize v5

The upstream project is steering users to replacements: or configMapGenerator + go-templating. Keeping vars: works today but may break in a future minor.

If time permits, plan a follow-up PR to migrate these five variable definitions to replacements: to stay within the v5 support matrix.

🤖 Prompt for AI Agents
In config/overlays/odh/kustomization.yaml between lines 23 and 57, the use of
the deprecated `vars:` feature should be replaced. To fix this, migrate the five
variable definitions currently using `vars:` to use the supported
`replacements:` feature or alternatively use `configMapGenerator` combined with
`go-templating`. This will ensure compatibility with Kustomize v5 and prevent
future breakage.

@openshift-merge-bot openshift-merge-bot bot merged commit 7e8b60b into opendatahub-io:main Aug 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants