Skip to content

Conversation

@jferrazbr
Copy link

@jferrazbr jferrazbr commented Oct 22, 2025

Issue #51881

Prepare KDM CI and test scripts to work when KDM marks Prime-only Kubernetes versions. Same idea as PR #1822 for v2.9, adapted per branch.

Problem

KDM CI and test scripts needs to:

  • Detect when a selected Kubernetes version requires Prime.
  • Choose staging or production Prime registry.
  • Fail early with a clear message if Prime is required but no registry endpoint is available in the environment.
  • Keep non-Prime behavior unchanged.

Solution

  • Prime detection in scripts:

    • Read channels, compare the release item’s "minChannelServerVersion" with "LAST_COMMUNITY_RANCHER" to decide Prime.
    • Pick "staging" or "production" Prime based on the version tag pattern.
    • Set "PRIME_MODE" and "PRIME_REG_HOST" for downstream provisioning test.
  • Early guard:

    • If "PRIME_MODE" is 1 but no registry endpoint is present, stop with a user-friendly message that explains why.
  • Defaults and safety:

    • Respect an already set "CATTLE_AGENT_IMAGE" from the environment. Only set a default if it is empty.
    • Keep normal flow when Prime is not required.
  • Workflow integration:

    • Variables "LAST_COMMUNITY_RANCHER" and "PRIME_AGENT_IMAGE" are passed from the workflow env. Scripts keep safe defaults for local runs.

@jferrazbr jferrazbr force-pushed the add-prime-mode-support-to-v2.11-provisioning-tests branch 5 times, most recently from 96048ec to d87292a Compare October 22, 2025 19:04
@jferrazbr
Copy link
Author

Green run with prime test from this commit ✔️

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Prime mode detection and registry routing logic to KDM provisioning tests for the v2.11 branch. When a selected Kubernetes version requires Rancher Prime (determined by comparing the version's minChannelServerVersion against a configured community cutoff), the scripts automatically select the appropriate Prime registry (staging or production) and configure the agent image accordingly.

Key changes:

  • Adds version comparison utilities (AWK scripts) to detect Prime-only Kubernetes versions based on channel metadata
  • Implements Prime registry selection logic with staging/production routing based on version tags
  • Integrates early failure checks when Prime is required but registry credentials are unavailable (common in fork PRs)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
scripts/semver_g.awk New AWK utility for semantic version comparison (A>B logic)
scripts/channels-pick-minchan-for-version.awk New AWK utility to extract minChannelServerVersion from channel YAML
scripts/prime-route Core Prime detection logic that sets PRIME_MODE, selects registry environment, and configures agent image
scripts/provisioning-tests Integration point that sources prime-route and implements early failure for missing registry credentials
.github/workflows/provisioning-tests.yaml Adds Vault secrets retrieval for Prime registries and sets LAST_COMMUNITY_RANCHER/PRIME_AGENT_IMAGE env vars
Dockerfile.dapper Passes through new environment variables (LAST_COMMUNITY_RANCHER, PRIME_AGENT_IMAGE, STAGE_REGISTRY_ENDPOINT)
docs/release.md Documents Prime configuration variables, their purpose, and maintenance instructions for release managers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jferrazbr jferrazbr force-pushed the add-prime-mode-support-to-v2.11-provisioning-tests branch 2 times, most recently from d6fa95e to fed2365 Compare December 15, 2025 21:49
@jakefhyde jakefhyde requested a review from a team December 16, 2025 14:38
@jferrazbr jferrazbr force-pushed the add-prime-mode-support-to-v2.11-provisioning-tests branch from fed2365 to a1f9f2a Compare December 26, 2025 11:35
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.

3 participants