Skip to content

Conversation

@rhuss
Copy link
Collaborator

@rhuss rhuss commented May 8, 2025

Add Version Checking for controller-gen Tool

Description

This PR enhances the Makefile by adding version checking for the controller-gen tool. Previously, the Makefile only checked if controller-gen was installed, but didn't verify if the installed version matched the version specified in CONTROLLER_TOOLS_VERSION. This could lead to subtle build issues if the wrong version was being used.

Motivation for this PR was that I had strange recommit issues because I had a local codegen binary in bin that was 0.17.2, but Makefile references 0.17.3. It didn't get reinstalled, but the GitHub action always installs it afresh (0.17.3) and therefor some differences in the generated manifest were detected.

Changes

  • Modified the controller-gen target in the Makefile to check both for existence AND version match
  • If either the tool doesn't exist or the version doesn't match, it will reinstall the correct version

Testing

Tested by:

  • Manually verifying version checking works by intentionally changing the CONTROLLER_TOOLS_VERSION
  • Confirming that the correct version gets installed when needed
  • Confirming that no reinstallation happens when the correct version is already present

Copy link
Collaborator

@VaishnaviHire VaishnaviHire left a comment

Choose a reason for hiding this comment

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

/lgtm

@VaishnaviHire VaishnaviHire merged commit ca5434e into llamastack:main May 8, 2025
3 checks passed
rhuss added a commit to rhuss/llama-stack-k8s-operator that referenced this pull request May 9, 2025
Updates to operator-sdk v1.39.2 and aligns the Makefiles for better consistency. It supersedes PR llamastack#20 which updated the makefile and controller-gen target.

Added a new 'pre-commit' makefile target to run pre-commit hooks on all files.
rhuss added a commit to rhuss/llama-stack-k8s-operator that referenced this pull request May 9, 2025
Updates to operator-sdk v1.39.2 and aligns the Makefiles for better consistency. It supersedes PR llamastack#20 which updated the makefile and controller-gen target.

Added a new 'pre-commit' makefile target to run pre-commit hooks on all files.
VaishnaviHire pushed a commit that referenced this pull request May 12, 2025
Updates to operator-sdk v1.39.2 and aligns the Makefiles for better
consistency with operator-sdk generated Makefile. It supersedes #20, and
allows for a more elegant way for installing tools locally (like its
done nowadays in the operator-sdk generated Makefiles).

Also aligned versions with the versions that operator-sdk v1.39.2 is
using.

Changes include:
- Update operator-sdk to v1.39.2
- Align Makefile with latest operator-sdk scaffold
- Improve tool dependency management
- Add pre-commit makefile target
- Update dependencies in go.mod
- Refactor install procedures for tools

Note: Due to the way how tools are downloaded now, it's recommended to
remove `bin/` to remove legacy tools.
VaishnaviHire pushed a commit to VaishnaviHire/llama-stack-k8s-operator that referenced this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants