feat(kube-ovn): build the chart and image in-tree, retiring the wrapper repo - #3460
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThe PR extends nightly image host rewriting for scalar registry values and adds coverage for that shape. It also replaces kube-ovn update/build plumbing with an upstream chart workflow, adds a multi-stage image build, applies MTU and VM migration patches, and updates chart values. ChangesNightly mirror host rewriting
Kube-ovn packaging
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
The chart and the image are now built in cozystack/cozystack under packages/system/kubeovn; see cozystack/cozystack#3460. PR #5 was carried into that move, so nothing here is left pending. Assisted-By: Claude
a5f8177 to
efb6de0
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/system/kubeovn/Makefile`:
- Around line 20-22: Extend the update target after the Dockerfile substitutions
to invoke the existing image target, so make update builds the image and writes
its digest to values.yaml. Preserve the current version extraction and
SED_INPLACE commands, and reuse the Makefile’s existing image workflow rather
than duplicating its steps.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 16fb8f01-41f0-4e37-9f3c-5c156adf8138
📒 Files selected for processing (8)
docs/agents/image-refs.mdhack/nightly-mirror.shhack/nightly-mirror_test.batspackages/system/kubeovn/Makefilepackages/system/kubeovn/images/kubeovn/Dockerfilepackages/system/kubeovn/images/kubeovn/patches/fix-keepvmip-portgroup.diffpackages/system/kubeovn/patches/mtu.diffpackages/system/kubeovn/values.yaml
| version=$$(awk '$$1 == "appVersion:" {print $$2}' charts/kube-ovn/Chart.yaml) && \ | ||
| $(SED_INPLACE) -e "s/ARG VERSION=.*/ARG VERSION=$${version}/" images/kubeovn/Dockerfile && \ | ||
| $(SED_INPLACE) -e "s/ARG TAG=.*/ARG TAG=v$${version}/" images/kubeovn/Dockerfile |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Invoke the image workflow from update.
update stops after modifying the Dockerfile at Line 22. It never runs image, so make update neither builds the image nor writes its digest to values.yaml.
Proposed fix
$(SED_INPLACE) -e "s/ARG VERSION=.*/ARG VERSION=$${version}/" images/kubeovn/Dockerfile && \
$(SED_INPLACE) -e "s/ARG TAG=.*/ARG TAG=v$${version}/" images/kubeovn/Dockerfile
+ $(MAKE) image📝 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.
| version=$$(awk '$$1 == "appVersion:" {print $$2}' charts/kube-ovn/Chart.yaml) && \ | |
| $(SED_INPLACE) -e "s/ARG VERSION=.*/ARG VERSION=$${version}/" images/kubeovn/Dockerfile && \ | |
| $(SED_INPLACE) -e "s/ARG TAG=.*/ARG TAG=v$${version}/" images/kubeovn/Dockerfile | |
| version=$$(awk '$$1 == "appVersion:" {print $$2}' charts/kube-ovn/Chart.yaml) && \ | |
| $(SED_INPLACE) -e "s/ARG VERSION=.*/ARG VERSION=$${version}/" images/kubeovn/Dockerfile && \ | |
| $(SED_INPLACE) -e "s/ARG TAG=.*/ARG TAG=v$${version}/" images/kubeovn/Dockerfile | |
| $(MAKE) image |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/system/kubeovn/Makefile` around lines 20 - 22, Extend the update
target after the Dockerfile substitutions to invoke the existing image target,
so make update builds the image and writes its digest to values.yaml. Preserve
the current version extraction and SED_INPLACE commands, and reuse the
Makefile’s existing image workflow rather than duplicating its steps.
kubeovn was the last package whose chart and image were produced by a separate repository: packages/system/kubeovn pulled a tarball from the latest cozystack/kubeovn-chart tag at update time, and that repository built and pushed the image. The wrapper existed only to cache the upstream chart; with the current caching that reason is gone, and the split cost a second repository, a second release step, and a package whose provenance a reader could not follow without leaving the tree. Move the wrapper in, shaped like packages/system/cilium: update pulls the upstream kube-ovn chart directly and applies patches/mtu.diff, and image builds images/kubeovn and pins the digest into values.yaml. The MTU patch already carried monorepo-relative paths, so it applies here unchanged. Also carries cozystack/kubeovn-chart#5, which never got a tag: pin OVN_IPSEC_KEY_DIR under /var/lib. The kube-ovn default sits in /etc/origin, which a Talos node cannot create, so enabling IPsec left the node without ESP security associations. Co-authored-by: Timofei Larkin <lllamnyp@gmail.com> Co-authored-by: Kirill Ilin <stitch14@yandex.ru> Co-authored-by: Aleksei Sviridkin <f@lex.la> Assisted-By: Claude Signed-off-by: Andrei Kvapil <andrei.kvapil@aenix.io>
The nightly host rewrite is a literal "<src-registry>/" substring replace, so it only reaches a host sitting contiguously in front of the repository. kubeovn keeps its host in global.registry.address with the bare repository in a sibling key: no trailing slash, no match. The image was mirrored to the public registry and the tree kept pointing at the private build registry. The gap was dormant while kubeovn's image came from a separate repository, because the baked ref carried the public host and the ownership filter skipped it. Building the image in-tree stamps the build-registry host into that key and turns it live, so fix it here. Add an end-of-line-anchored expression that fires only when the source registry is the complete value; a contiguous ref continues past the host, so the two expressions cannot both fire on one reference. keycloak-operator splits at a different boundary and stays unfixed -- neither of its keys holds the source registry as a whole. Documented, and dormant while no CI path rebuilds it. Assisted-By: Claude Signed-off-by: Andrei Kvapil <andrei.kvapil@aenix.io>
efb6de0 to
6cb5793
Compare
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM. Reviewed the current head end-to-end (helm template across default / mtu on-off / ENABLE_OVN_IPSEC on-off, the nightly-mirror bats suite, and byte-diff of charts/kube-ovn against upstream v1.15.10 + mtu.diff). No regressions on any supported path: the image digest in values.yaml is unchanged from main, so running clusters do not swap the image on merge; fresh install renders; upgrade is safe; this PR actually improves air-gap (nightly-mirror fix).
Non-blocking notes for a follow-up:
- patches/mtu.diff:4 — hunk counters are off (@@ -122,6 +122,9 @@ should be @@ -122,5 +122,8 @@). GNU patch (used by
make update) applies it fine with fuzz, so the re-apply loop is not broken, but the header is worth fixing for robustness. - Makefile:1,20,22 —
awk '$1=="appVersion:"{print $2}'returns the value with quotes, somake updatewould rewrite the Dockerfile ARG as v"1.15.10" and not round-trip. Harmless today but fragile;-F'"'or gsub would fix it. - Follow-up: default render still references a vpc-nat-gateway image that nothing in-tree builds/mirrors (pre-existing, identical to main). Worth confirming its publication survives retiring the wrapper repo.
What this PR does
Brings the
kubeovn-chartwrapper into the tree, socozystack/kubeovn-chartcan be archived.Until now
packages/system/kubeovnpulled a chart tarball from the latestcozystack/kubeovn-charttag atmake updatetime, and that repository also built and pushed thekubeovnimage. The wrapper existed only to cache the upstream chart; with the current caching approach that reason is gone, and the split cost a second repository, a second release step, and a package whose provenance a reader cannot follow without leaving the tree.The package is now shaped like
packages/system/cilium:updatepulls the upstreamkubeovn/kube-ovnchart directly and appliespatches/mtu.diff, then syncs the version into the Dockerfile. The MTU patch already carried monorepo-relative paths, so it applies unchanged.imagebuildsimages/kubeovn(carrying the existingfix-keepvmip-portgrouppatch) and pins the digest intovalues.yaml, using the sharedimage-tags/cache-argshelpers.It also carries
cozystack/kubeovn-chart#5, which never got a tag:OVN_IPSEC_KEY_DIRis pinned under/var/lib. The kube-ovn default sits in/etc/origin, which a Talos node cannot create, so enabling IPsec left the node without ESP security associations.The nightly host rewrite had to be fixed first
Moving the image build here activates a gap recorded in
docs/agents/image-refs.md. The nightly host rewrite is a literal<src-registry>/substring replace, and kubeovn keeps its host inglobal.registry.addresswith the bare repository in a sibling key — no trailing slash, no match. While the image came from a separate repository the baked reference carried the public host and the ownership filter skipped it; once CI builds the image here it stamps the build-registry host into that key, and the result is an image mirrored to the public registry while the published tree keeps pointing at the private build registry.The second commit adds an end-of-line-anchored expression that fires only when the source registry is the complete scalar value, so a contiguous reference — which continues past the host — is still handled by the first expression and the two can never both fire on one reference.
keycloak-operatorsplits at a different boundary and stays unfixed; that is documented, and dormant while no CI path rebuilds it.Verified:
hack/nightly-mirror_test.batspasses with the new case and the case fails without the fix;promote-retagandpromote-rewrite-tagssuites unaffected;helm templateandhelm unitteston the package pass. The pre-existinghelm lintcomplaint about a missingkube-ovndependency reproduces onmainand is left alone.Follow-ups this PR does not do
cozystack/kubeovn-chartshould be archived once this merges, with a pointer here. Its open PR SpecifyreconcileStrategy: Revisionfor system charts #5 is carried by this change and needs no separate landing.cozystack/websitelinks the Kube-OVN license atcozystack/kubeovn-chartinoperations/configuration/licenses.mdandguides/platform-stack/_index.md(all versions, includingnext). Archived repositories stay readable so nothing breaks, but the link should move upstream or in-tree. No follow-up has been opened yet — flagging rather than ticking the box.Screenshots
N/A — build and packaging change, no user-facing or UI impact.
Downstream repositories
Walked the trigger map against the diff. The website row matches — not through the app-list or platform-component triggers, but because two of its pages link the repository being archived. Left unticked because no follow-up exists there yet; a human should decide whether the license link moves to
kubeovn/kube-ovnor to this package. No other row matches: the change touches nopackages/apps/orpackages/extra/package, novalues.schema.json, noApplicationDefinition, no platform variant, and no node prerequisite.Release note
Summary by CodeRabbit
New Features
update.OVN_IPSEC_KEY_DIRto standardize the OVN IPsec keys directory.Bug Fixes
Tests
Documentation