Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kamaji make update #598

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Fix kamaji make update #598

merged 2 commits into from
Jan 23, 2025

Conversation

RaSerge
Copy link
Contributor

@RaSerge RaSerge commented Jan 22, 2025

Fix makefile update target for kamaji
Fix Dockerfile for kamaji (golang:1.23 as builder)
kamaji Chart updated

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced DataStore configuration with more flexible inheritance and schema definition
    • Added support for advanced network profile settings
  • Improvements

    • Updated Kamaji application to version edge-24.12.1
    • Upgraded Go runtime to version 1.23
    • Improved documentation for DataStore and configuration settings
  • Dependency Updates

    • Updated kamaji-etcd dependency to version >=0.8.1
  • Version Changes

    • Reset application and chart versions to 0.0.0

@RaSerge RaSerge requested a review from kvaps as a code owner January 22, 2025 09:24
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 22, 2025
Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

Walkthrough

This pull request introduces changes to the Kamaji package, focusing on version updates and configuration improvements. The modifications span multiple files in the Kamaji charts and Dockerfile, including updates to versioning information, dependency requirements, and configuration handling. The changes primarily affect how DataStore configurations are managed, with enhanced flexibility in setting default values and more precise validation rules for Tenant Control Plane configurations.

Changes

File Change Summary
Makefile Updated Dockerfile version tag handling
charts/kamaji/Chart.yaml - Downgraded appVersion from v1.0.0 to v0.0.0
- Downgraded version from 2.0.0 to 0.0.0
- Updated kamaji-etcd dependency to >=0.8.1
charts/kamaji/README.md - Updated version badges
- Enhanced defaultDatastoreName configuration description
charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml - Added dataStoreSchema field
- Enhanced dataStore specifications
- Added validation for network profile settings
charts/kamaji/templates/controller.yaml Modified defaultDatastoreName handling to be more flexible
charts/kamaji/values.yaml Updated comment for defaultDatastoreName
images/kamaji/Dockerfile - Updated Go version from 1.22 to 1.23
- Updated Kamaji version from edge-24.9.2 to edge-24.12.1

Possibly related PRs

Suggested labels

enhancement, documentation

Suggested reviewers

  • kvaps

Poem

🐰 In Kamaji's realm of code so bright,
Versions dance with playful might
DataStores shift, configurations gleam
A rabbit's update, a developer's dream!
Hop along the version trail, so light! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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. (Beta)
  • @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
Contributor

@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: 2

🔭 Outside diff range comments (1)
packages/system/kamaji/charts/kamaji/templates/controller.yaml (1)

Invalid Go version golang:1.23 specified in Dockerfile

The Dockerfile at packages/system/kamaji/images/kamaji/Dockerfile specifies FROM golang:1.23, but Go 1.23 is not yet released and doesn't exist. As of January 2025, the latest stable Go version is 1.21.x.

🔗 Analysis chain

Line range hint 1-1: Verify golang version in Dockerfile.

The PR description mentions updating to golang:1.23, but this seems incorrect as Go 1.23 is not yet released (latest stable is 1.21.x as of January 2025).

Please run this script to verify the Go version:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if golang:1.23 is valid and get latest available versions

echo "Checking available golang versions..."
curl -s https://go.dev/dl/?mode=json | jq -r '.[].version' | head -n 5

echo -e "\nChecking Dockerfile..."
rg "FROM golang:" "packages/system/kamaji/Dockerfile"

Length of output: 367


Script:

#!/bin/bash
# Find Dockerfile and verify golang versions
echo "Searching for Dockerfile..."
fd Dockerfile

echo -e "\nChecking available golang versions from Docker Hub..."
curl -s "https://hub.docker.com/v2/repositories/library/golang/tags?page_size=10" | jq -r '.results[].name' | grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || echo "No matching versions found"

Length of output: 1641


Script:

#!/bin/bash
# Check Dockerfile content and golang versions
echo "Reading Dockerfile content..."
cat "packages/system/kamaji/images/kamaji/Dockerfile"

echo -e "\nChecking available golang versions..."
curl -s "https://registry.hub.docker.com/v2/repositories/library/golang/tags?page=1&page_size=5&ordering=last_updated" | jq -r '.results[].name'

Length of output: 1432

🧹 Nitpick comments (1)
packages/system/kamaji/charts/kamaji/README.md (1)

25-25: Fix markdown lint issue

The bare URL in the repository table should be properly formatted.

-| https://clastix.github.io/charts | kamaji-etcd | >=0.8.1 |
+| <https://clastix.github.io/charts> | kamaji-etcd | >=0.8.1 |
🧰 Tools
🪛 Markdownlint (0.37.0)

25-25: null
Bare URL used

(MD034, no-bare-urls)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 06afcf2 and 16a9176.

⛔ Files ignored due to path filters (1)
  • packages/system/kamaji/charts/kamaji/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • packages/system/kamaji/Makefile (1 hunks)
  • packages/system/kamaji/charts/kamaji/Chart.yaml (2 hunks)
  • packages/system/kamaji/charts/kamaji/README.md (3 hunks)
  • packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (3 hunks)
  • packages/system/kamaji/charts/kamaji/templates/controller.yaml (1 hunks)
  • packages/system/kamaji/charts/kamaji/values.yaml (1 hunks)
  • packages/system/kamaji/images/kamaji/Dockerfile (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/system/kamaji/charts/kamaji/values.yaml
🧰 Additional context used
🪛 Markdownlint (0.37.0)
packages/system/kamaji/charts/kamaji/README.md

25-25: null
Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (7)
packages/system/kamaji/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml (2)

6415-6431: LGTM! Improved DataStore configuration with better safety.

The changes enhance the DataStore configuration by:

  • Clarifying default value inheritance behavior
  • Adding the DataStoreSchema field with proper immutability validation
  • Preventing accidental data loss by disallowing unsetting of DataStore fields

Line range hint 6554-6620: LGTM! Enhanced NetworkProfile with robust validation rules.

The changes strengthen the NetworkProfile configuration by:

  • Adding immutable clusterDomain field with proper validation
  • Adding immutable loadBalancerClass field
  • Adding loadBalancerSourceRanges for better security control
  • Implementing cross-field validations to ensure LoadBalancer settings are used correctly
packages/system/kamaji/charts/kamaji/templates/controller.yaml (1)

36-38: LGTM! The conditional handling of defaultDatastoreName looks good.

The change improves flexibility by making the --datastore argument optional while maintaining backward compatibility.

Please ensure that:

  1. This change is documented in the values.yaml file
  2. The default value in values.yaml aligns with this new behavior
  3. Any existing documentation is updated to reflect that defaultDatastoreName is now optional

Run this script to verify the documentation:

✅ Verification successful

Documentation and configuration are properly aligned with the new behavior

The defaultDatastoreName is:

  • Correctly documented in README.md with "If specified" clause
  • Properly configured in values.yaml with default value "default"
  • Implementation matches both documentation and configuration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check values.yaml and documentation for defaultDatastoreName

echo "Checking values.yaml for defaultDatastoreName..."
rg -A 5 "defaultDatastoreName:" "packages/system/kamaji/charts/kamaji/values.yaml"

echo -e "\nChecking documentation..."
rg -A 5 "defaultDatastoreName" "packages/system/kamaji/charts/kamaji/README.md"

Length of output: 982

packages/system/kamaji/Makefile (1)

12-12: LGTM! Improved version update mechanism

The change correctly updates the ARG VERSION line instead of the FROM line, which aligns better with the Dockerfile structure.

packages/system/kamaji/charts/kamaji/Chart.yaml (2)

2-2: Verify version reset strategy

The version and appVersion have been reset to 0.0.0. This is an unusual change that requires clarification:

  • Was this intentional?
  • Does this align with the project's versioning strategy?

Please confirm if this is part of a broader versioning strategy change.

Also applies to: 20-20


24-24: Verify kamaji-etcd compatibility

The kamaji-etcd dependency version has been updated to >=0.8.1.

✅ Verification successful

Version compatibility verified successfully

The kamaji-etcd chart version >=0.8.1 is available in the repository. Compatible versions found: 0.8.1, 0.9.0, and 0.9.1.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify kamaji-etcd chart version compatibility
curl -s https://clastix.github.io/charts/index.yaml | \
  yq e '.entries."kamaji-etcd"[] | select(.version >= "0.8.1") | .version' -

Length of output: 223


Script:

#!/bin/bash
# Fetch the chart repository index and search for kamaji-etcd versions
curl -s https://clastix.github.io/charts/index.yaml | grep -A 2 "name: kamaji-etcd$"

Length of output: 1660


Script:

#!/bin/bash
# Fetch the chart repository index and extract version numbers
curl -s https://clastix.github.io/charts/index.yaml | grep -A 5 "name: kamaji-etcd$" | grep "version: "

Length of output: 105


Script:

#!/bin/bash
# Save the index.yaml content to examine the structure
curl -s https://clastix.github.io/charts/index.yaml > /tmp/index.yaml
head -n 50 /tmp/index.yaml

Length of output: 1860


Script:

#!/bin/bash
# Extract kamaji-etcd section and find versions
curl -s https://clastix.github.io/charts/index.yaml | \
  sed -n '/^  kamaji-etcd:/,/^  [a-z]/p' | \
  grep "version: " | \
  sort -V

Length of output: 484

packages/system/kamaji/charts/kamaji/README.md (1)

73-73: LGTM! Improved configuration documentation

The description for defaultDatastoreName has been enhanced to better explain its behavior with unassigned DataStore instances.

@@ -1,7 +1,7 @@
# Build the manager binary
FROM golang:1.22 as builder
FROM golang:1.23 as builder
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Invalid Go version specified

The specified Go version 1.23 does not exist yet. The latest stable version is 1.22.

Apply this diff to fix the version:

-FROM golang:1.23 as builder
+FROM golang:1.22 as builder
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
FROM golang:1.23 as builder
FROM golang:1.22 as builder


ARG VERSION=edge-24.9.2
ARG VERSION=edge-24.12.1
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Invalid Kamaji version specified

The version edge-24.12.1 appears to be invalid:

  • This version tag does not exist in the Kamaji repository
  • The repository uses semantic versioning (latest: v1.0.0) without any "edge-" prefixes
  • Please verify and update to a valid version tag from https://github.com/clastix/kamaji/tags
🔗 Analysis chain

Verify Kamaji version compatibility

The version has been updated to edge-24.12.1. Let's verify this version exists and is compatible.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the specified version exists in the Kamaji repository
gh api repos/clastix/kamaji/tags --jq '.[].name' | grep -q "edge-24.12.1" && \
  echo "Version edge-24.12.1 exists" || \
  echo "Version edge-24.12.1 not found"

Length of output: 144


Script:

#!/bin/bash
# List the 10 most recent tags from the Kamaji repository
gh api repos/clastix/kamaji/tags --jq '.[0:10] | .[] | .name'

Length of output: 133

Copy link
Member

@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 23, 2025
@kvaps kvaps merged commit 05857b9 into aenix-io:main Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants