Skip to content

Kagenti installer uses hardcoded operator version #171

Description

@cwiklik

Problem Description

The Kagenti installer currently uses a hardcoded version of the operator in kagenti/installer/app/config.py. Each time the operator version changes, the installer must be manually updated to reference the new version.

Below is a snippet from config.py showing current configuration:

# --- Cluster & Operator Configuration ---
CLUSTER_NAME = "agent-platform"
OPERATOR_NAMESPACE = "kagenti-system"
TEKTON_VERSION = "v0.66.0"
**LATEST_TAG = "0.2.0-alpha.4"**

Expected Behavior

  • Installer should automatically detect and use the latest operator version
  • No manual updates required when new operator versions are released

Proposed Solution

Replace hardcoded version with dynamic version detection using python code below:

def get_latest_operator_version():
  try:
      result = subprocess.run(
           ["git", "describe", "--tags", "--abbrev=0"],
           capture_output=True, text=True, check=True
      )
      return result.stdout.strip().lstrip('v')
....

Activity

  1. self-assigned this
    on Sep 2, 2025
  2. added
    enhancement
    on Sep 2, 2025
  3. added theissue type on Sep 2, 2025
  4. pdettori commented on Sep 2, 2025

    @pdettori
    Member

    One challenge to the detector is that when we run the installer we run from the kagenti git repo, while the tag in question applies to the kagenti-operator repo.

  5. cwiklik commented on Sep 2, 2025

    @cwiklik
    ContributorAuthor

    @pdettori good catch. I need to use a different approach, perhaps based on git API. Will investigate that.

  6. pdettori commented on Sep 2, 2025

    @pdettori
    Member

    One issue with GH API - unless authenticating with a token, you may get HTTP error occurred: 403 Client Error: rate limit exceeded for url. I was thinking to experiment with something like https://github.com/kagenti/kagenti-operator/pull/66 to automate creating a file with latest version info on the repo itself

  7. cwiklik commented on Sep 2, 2025

    @cwiklik
    ContributorAuthor

    Below is an alternative way to fetch kagenti-operator's release tag. This code extracts the latest tag from a sorted list of releases.

    ...
      url = "https://api.github.com/repos/kagenti/kagenti-operator/releases
      response = requests.get(url, timeout=40)
    
      if response.status.code == 200:
         releases = response.json()
         for release in releases:
            tag = release["tag"].lstrip('v')
            return tag
    ...  
    
  8. cwiklik commented on Sep 2, 2025

    @cwiklik
    ContributorAuthor

    Ok, the limit is a concern. I played with git commands and found this to work:

    
    git ls-remote --tags  --sort=-version:refname https://github.com/kagenti/kagenti-operator.git
    ef9b15d43513a01aa547d052ece0a72c98091f7f	refs/tags/v0.2.0-alpha.4
    118d96a98f9ece4c8d9e99480a3a7186f4ba6d83	refs/tags/v0.2.0-alpha.3
    1589453d00651c3253077347f259a332edaf9d5c	refs/tags/v0.2.0-alpha.2
    2d8405dba50460d98c7dece5d4b1afc02f3d505d	refs/tags/v0.2.0-alpha.1
    a8bbdf883c2531a8a465c7dbddf2155eae52fcae	refs/tags/v0.1.0-alpha
    

    So just exec the git command in python and extract the version from the first item in the list.

  9. pdettori commented on Sep 2, 2025

    @pdettori
    Member

    that seems to work as it should not hit the rate limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions