Menu

#1338 [kamaji] Pass in-tree image as migrate-image

closed
nobody
backport (46)
2025-08-12
2025-08-12
Anonymous
No

Originally created by: lllamnyp

What this PR does

The in-tree build of the Kamaji image lacks the appropriate ldflags, resulting in invalid flags of the Kamaji controller manager binary. When a migration job starts, it tries to pull an image with an explicit empty string as a tag, which is invalid. This patch sets the in-tree image as the image for the migration job, both working around this issue, as well as being consistent in the image used.

Release note

[kamaji] Fix broken migration jobs originating from missing environment variables in the in-tree build.

Summary by CodeRabbit

  • Chores
  • Automatically sets the Kamaji migrate image argument during builds to match the configured registry, tag, and digest.
  • Updates deployment values to include the migrate image reference so all Kamaji images are consistently pinned.
  • Reduces manual configuration and improves reliability of deployments and upgrades by ensuring migrate image is kept in sync.

Related

Tickets: #1339
Tickets: #1340

Discussion

  • Anonymous

    Anonymous - 2025-08-12

    Originally posted by: coderabbitai[bot]

    [!NOTE]

    Other AI code review bot(s) detected

    CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

    Walkthrough

    Extends the kamaji Makefile image target to compute a migrate-image argument and inject it into values.yaml. Defines REPOSITORY from REGISTRY, reuses TAG with digest from images/kamaji.json, and updates .kamaji.extraArgs[0] via yq. No existing lines removed; logic appended.

    Changes

    Cohort / File(s) Summary
    Build pipeline and config injection
    packages/system/kamaji/Makefile
    Adds a shell block in the image target to set REPOSITORY="$(REGISTRY)/kamaji", compute TAG including digest from images/kamaji.json, and write .kamaji.extraArgs[0]="--migrate-image=${REPOSITORY}:${TAG}" into values.yaml using yq. Extends existing repository/tag update flow without deletions.

    Sequence Diagram(s)

    sequenceDiagram
        participant Dev as Developer
        participant MK as Makefile (image target)
        participant IMG as images/kamaji.json
        participant YQ as yq
        participant VY as values.yaml
    
        Dev->>MK: run image target
        MK->>IMG: read digest/tag
        MK->>MK: set REPOSITORY and TAG
        MK->>YQ: write .kamaji.extraArgs[0]="--migrate-image=REPOSITORY:TAG"
        YQ->>VY: update values.yaml
    

    Estimated code review effort

    🎯 3 (Moderate) | ⏱️ ~15 minutes

    Poem

    I hop through Makefiles, quick and keen,
    Binding digests to a migrate scene.
    A flag tucked neat where configs play,
    Values updated, ready to relay.
    Carrots & commits, stitched in a stream. 🥕

    ✨ Finishing Touches
    🧪 Generate unit tests - [ ] Create PR with unit tests - [ ] Post copyable unit tests in a comment - [ ] Commit unit tests in branch `fix/kamaji-migrate-image`

    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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
    🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=cozystack/cozystack&utm_content=1338): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>, please review it.` - `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. - 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 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](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions. ### CodeRabbit Commands (Invoked using PR/Issue comments) Type `@coderabbitai help` to get the list of available commands. ### 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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` ### Status, Documentation and Community - Visit our [Status Page](https://status.coderabbit.ai) to check the current availability of CodeRabbit. - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </commit_id>
     
  • Anonymous

    Anonymous - 2025-08-12

    Ticket changed by: kvaps

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2025-08-12

    Originally posted by: github-actions[bot]

    Successfully created backport PR for release-0.34:

     

    Related

    Tickets: #1340


Log in to post a comment.