Conversation
MirahImage
approved these changes
Feb 10, 2026
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
mkuratczyk
approved these changes
Feb 11, 2026
aa59ef5 to
c6055bc
Compare
Member
Author
|
Holding off merging until we pass Feb release of rabbitmq |
Member
Author
|
@copilot rebase on top of |
Contributor
...with modernized build system and e2e test improvements This commit completes the migration to Kubebuilder v4, introducing significant improvements to the build system, tooling, and e2e test infrastructure. Build System & Tooling: - Modernize Makefile with local tool installation using versioned binaries in bin/ - Add go-install-tool function for automatic tool version management with symlinks - Implement proper tool caching and version tracking (kustomize, controller-gen, ytt, etc.) - Remove legacy internal/tools/ directory in favor of declarative tool management - Add LOCALBIN variable and organized tool sections with ##@ categories - Improve shell configuration with bash -o pipefail for safer command execution - Fix ENVTEST_K8S_VERSION resolution bug (x.y.z path vs x.y variable) - Auto-detect tool versions from go.mod dependencies E2E Test Infrastructure: - Refactor e2e tests to use KinD with local image loading instead of non-existent registry - Change operator image from example.com/messaging-topology-operator to localhost/messaging-topology-operator - Update e2e suite to use IfNotPresent pull policy with locally loaded images - Add KinD installation and management targets with version checking - Simplify e2e test code by removing complex sed commands - Add YTT overlays: skip_namespace.yml, always_pull.yml, add_pull_secrets.yml CI/CD Improvements: - Update GitHub workflows (pr.yml, test-e2e.yml, lint.yml, codeql-analysis.yml) - Add caching for Go modules and tool binaries in CI - Refactor workflows to use new Makefile targets - Use local tools (./bin/kustomize, ./bin/ytt) instead of system-installed tools - Remove obsolete test.yml workflow Kubebuilder v4 Migration: - Update PROJECT file with Kubebuilder v4 metadata - Modernize cmd/main.go with improved manager setup - Restructure config/ directory (remove nested overlays, update kustomization files) - Add operatorpolicy webhook and sample resources - Update all webhook files to use new controller-runtime patterns - Reorganize RBAC and CRD configuration structure Configuration Changes: - Simplify config/default/kustomization.yaml (remove nested base/overlays structure) - Update config/manager with new image references and structure - Add config/rbac/operatorpolicy_admin_role.yaml - Update service account and role binding configurations The migration improves developer experience with faster tool installation, better caching, more reliable e2e tests, and alignment with Kubebuilder v4 best practices. Co-authored-by: Cursor <[email protected]>
Naming is hard. Renaming is harder. Specially when two names are almost identical except for one word.
The new layout provided e2e tests under `test/` folder. For consistency, it makes sense to have system tests under the same folder, because our system tests are a form of e2e tests. The ability to configure the service type allows to run system tests in different local k8s flavours, for example, in k3d + traeffik a.k.a Rancher Desktop. In some local environments, accesing the NodePort service is not possible, because Docker runs inside a VM and the host may not redirect all ports to the VM.
It was removed by the re-scaffold
This script will be required as a one off task when users upgrade to Topology Operator v1.19+ This version of the Operator went through a major refactor to catch up with Kubebuilder latest version and modern project layout.
3b91e06 to
8455bde
Compare
Member
Author
Because label selectors in the Deployment spec is inmutable. If we change the selectors, it will be impossible to in-place upgrade, and users will have to delete-redeploy. This commit also includes `go fmt` and a minor fix to one of the examples.
e9630a4 to
f5261e6
Compare
The most serious issue was that installation manifests were generated incorrectly. The "dockerhub" manifest was generated with an image name that pointed to `localhost/...`. This commit now sets the "dockerhub" manifest to use GHCR. This is intended and it's part of an initiative to abandon DockerHub image publishing. The other fix was that our tests were not using Ginkgo CLI, even tho there's a maketarget to install it locally.
f5261e6 to
b0e77bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the messaging-topology-operator to the latest Kubebuilder v4 project layout and conventions, resulting in significant structural changes while maintaining all core functionality.
Key Changes
🏗️ Major Project Restructuring
Entry Point Migration:
main.go→cmd/main.go(following Kubebuilder v4 convention)Controller Organization:
controllers/→internal/controller/<resource>_controller.gopatternsystem_tests/→test/system/Webhook Reorganization:
controllers/tointernal/webhook/📦 Resource Naming Changes
This refactor introduces breaking changes to resource names for better namespace isolation:
Services:
webhook-service→messaging-topology-webhook-servicemessaging-topology-controller-metrics-serviceValidatingWebhookConfiguration:
topology.rabbitmq.com→messaging-topology-validating-webhook-configurationCert-manager Resources (with-certmanager variant):
serving-cert→messaging-topology-serving-certselfsigned-issuer→messaging-topology-selfsigned-issuerNew RBAC for Metrics:
ClusterRole: messaging-topology-metrics-auth-roleClusterRole: messaging-topology-metrics-readerClusterRoleBinding: messaging-topology-metrics-auth-rolebinding🔧 CI/CD Improvements
.github/workflows/pr.yml:
actions/cache@v4forbin/directory)make unit-testsandmake integration-testsnow include all checks${{ runner.temp }}instead of/tmpsetup-ginkgoaction (now installed via Makefile).github/workflows/build-test-publish.yml:
id-token: 'write'permission (unused).github/workflows/lint.yml (NEW):
.github/workflows/test-e2e.yml (NEW):
.github/workflows/olm.yml:
system_tests/→test/system/).github/workflows/codeql-analysis.yml:
🛠️ Makefile Modernization
Comprehensive rewrite with Kubebuilder v4 conventions:
./bin/with smart cachinggo.moddependenciesmake help- Categorized help menu with descriptionsmake install-tools- Installs all required toolingmake lint/make lint-fix- golangci-lint integrationmake test-e2e- E2E test target with Kind cluster management📝 Configuration Updates
Project Metadata (
PROJECTfile):go.kubebuilder.io/v3togo.kubebuilder.io/v4Kustomize Manifests:
controller→managerDocker Improvements:
.dockerignorefor more efficient builds (excludes test files)🧪 Testing Infrastructure
📚 Documentation
New Files:
AGENTS.md- Comprehensive AI agent guide for Kubebuilder projects.golangci.yml- Linter configuration with extensive rule set.devcontainer/- Dev container support for consistent development environmentsUpdated:
🗑️ Removed
.github/ISSUE_TEMPLATE/- Removed custom issue templates (using defaults)Migration Impact
For Users Upgrading:
A cleanup script has been added (
cleanup-old-resources.sh) to delete old resources before applying the new manifests:For Developers:
make install-toolsTesting
This migration positions the operator for better maintainability and alignment with current Kubernetes operator best practices while preserving all existing functionality.