-
Notifications
You must be signed in to change notification settings - Fork 127
[v2.10] add prime mode logic to the provisioning-tests script #1841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-v2.10
Are you sure you want to change the base?
[v2.10] add prime mode logic to the provisioning-tests script #1841
Conversation
cdbb559 to
76f1116
Compare
|
Green run with prime test from this commit ✔️ |
There was a problem hiding this 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 logic to the KDM provisioning test scripts for the v2.10 branch. It enables the test infrastructure to detect when a selected Kubernetes version requires Rancher Prime, select the appropriate registry (staging or production), and fail gracefully with clear messaging when Prime is required but registry credentials are unavailable.
Key Changes:
- Implements semantic version comparison and channel metadata parsing utilities to detect Prime-only K8s versions
- Adds prime-route script that determines Prime mode, selects registry environment, and configures agent images
- Integrates Prime detection into provisioning tests with early validation and clear error messages
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/semver_g.awk | AWK utility for semantic version comparison (major.minor.patch), ignoring pre-release suffixes |
| scripts/channels-pick-minchan-for-version.awk | AWK utility to extract minChannelServerVersion from channels YAML for a specific K8s version |
| scripts/prime-route | Main Prime detection logic that compares versions, selects staging/production registry, and configures agent image |
| scripts/provisioning-tests | Integrates prime-route sourcing and validates registry availability when Prime mode is required |
| Dockerfile.dapper | Exposes new environment variables (LAST_COMMUNITY_RANCHER, PRIME_AGENT_IMAGE, STAGE_REGISTRY_ENDPOINT) to Dapper |
| .github/workflows/provisioning-tests.yaml | Adds Vault secret retrieval for registry endpoints and sets Prime configuration variables |
| docs/release.md | Documents Prime configuration variables, when to update them, and related rancher/rancher workflow pin requirements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # If Prime is on and PRIME_AGENT_IMAGE is set, override CATTLE_AGENT_IMAGE | ||
| if [[ -n "${PRIME_AGENT_IMAGE:-}" ]]; then |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition checks if PRIME_AGENT_IMAGE is set before overriding CATTLE_AGENT_IMAGE, but PRIME_AGENT_IMAGE always has a default value set at line 16-18. This means the override will always occur when in Prime mode, even if the user explicitly set CATTLE_AGENT_IMAGE in their environment. The description states "Respect an already set CATTLE_AGENT_IMAGE from the environment", but this logic doesn't check if CATTLE_AGENT_IMAGE was already set.
| # If Prime is on and PRIME_AGENT_IMAGE is set, override CATTLE_AGENT_IMAGE | |
| if [[ -n "${PRIME_AGENT_IMAGE:-}" ]]; then | |
| # If Prime is on and PRIME_AGENT_IMAGE is set, override CATTLE_AGENT_IMAGE only if not already set | |
| if [[ -n "${PRIME_AGENT_IMAGE:-}" && -z "${CATTLE_AGENT_IMAGE:-}" ]]; then |
76f1116 to
674386a
Compare
674386a to
ebe06dc
Compare
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:
Solution
Prime detection in scripts:
Early guard:
Defaults and safety:
Workflow integration: