Skip to content

❇️ Replace hardcoded operator version with dynamic GitHub tag detection - #177

Merged
pdettori merged 3 commits into
rossoctl:mainfrom
cwiklik:use-operator-version-detector
Sep 5, 2025
Merged

pdettori merged 3 commits into
rossoctl:mainfrom
cwiklik:use-operator-version-detector

Conversation

@cwiklik

@cwiklik cwiklik commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Summary

Fixes Kagenti installer which used a hardcoded operator version. The installer now automatically detects and uses the latest operator release from the kagenti-operator repository.

Problem

  • Installer contained hardcoded operator version (ex. 0.2.0-alpha.4)

  • Required manual updates every time a new operator version was released

  • Risk of deploying outdated operator versions in new installations

  • Created operational overhead for maintenance

Solution

Implemented dynamic version detection that:

  • Queries the kagenti-operator repository for the latest semantic version tag

  • Uses git ls-remote to avoid pull limit error

Changes Made

Added get_latest_operator_version() function

  • Uses git ls-remote --tags --sort=-version:refname to query remote tags

  • Parses semantic versions using the packaging library

  • Returns the highest semantic version found

Fixes #171

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like the minimum version of Git that supports git ls-remote --sort is Git 2.18. What should be used for the max? The latest git (2.51.0)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes or even better we can also use a very large number since we are more interested in the minimum version (e.g. 2.99.0 )

Jarek Cwiklik added 3 commits September 5, 2025 13:57
Signed-off-by: Jarek Cwiklik <[email protected]>
Signed-off-by: Jarek Cwiklik <[email protected]>
@cwiklik
cwiklik force-pushed the use-operator-version-detector branch from a52acb4 to 8f21602 Compare September 5, 2025 18:03

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

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.

Kagenti installer uses hardcoded operator version

2 participants