Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions infra/netris/inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ aws_access_key_id: "{{ lookup('ini', 'aws_access_key_id section=default file=' +
aws_secret_access_key: "{{ lookup('ini', 'aws_secret_access_key section=default file=' + config_path, errors='ignore') | default(lookup('env', 'AWS_SECRET_ACCESS_KEY'), true) }}"
aws_region: "{{ lookup('ini', 'aws_region section=default file=' + config_path, errors='ignore') | default(lookup('env', 'AWS_DEFAULT_REGION'), true) | default('us-east-1', true) }}"

# CaaS release image -- version must match a version present in the
# snapshot's AgentServiceConfig OS_IMAGES.
caas_release_image: "quay.io/openshift-release-dev/ocp-release:{{ ocp_version }}.0-multi"
# CaaS cluster version -- must match a ClusterVersion present in the
# deployed fulfillment-service (metadata.name or spec.version).
caas_cluster_version: "{{ ocp_version }}.0"
Comment on lines +83 to +85

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C 3 '\bocp_version\b' \
  --glob '*.yml' --glob '*.yaml' --glob '*.j2' --glob '*.ini' --glob '*.sh' .

Repository: osac-project/osac-test-infra

Length of output: 4839


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Tracked files containing ocp_version/caas_cluster_version:\n'
git ls-files | xargs rg -l '\bocp_version\b|\bcaas_cluster_version\b' || true

printf '\nRelevant source snippets:\n'
for f in infra/netris/inventory/group_vars/all.yml infra/netris/playbooks/post-osac.yml infra/netris/roles/prep-osac/tasks/main.yml infra/netris/roles/discover-caas/templates/infraenv.yml.j2; do
  if [ -f "$f" ]; then
    echo "--- $f"
    rg -n -C 3 '\bocp_version\b|\bcaas_cluster_version\b' "$f" || true
  fi
done

printf '\nStatic verifier: if ocp_version already contains 3 dotted numeric components, the derived variable is 4 dotted numeric components.\n'
python3 - <<'PY'
import re
pats = ["4.22", "4.22.0"]
for v in pats:
    derived = v + ".0"
    segs = derived.split(".")
    print(f"ocp_version={v!r} -> {derived!r}, numeric_segments={sum(bool(re.fullmatch(r'\\d+', s)) for s in segs)}")
print("Current tracked default:", "4.22")
PY

Repository: osac-project/osac-test-infra

Length of output: 3660


Validate ocp_version before deriving caas_cluster_version.

The current inventory default is 4.22, so the derived 4.22.0 is valid. Any ocp_version override that already includes the patch, such as 4.22.0, produces 4.22.0.0. Add validation or normalize the value before appending .0.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/netris/inventory/group_vars/all.yml` around lines 83 - 85, Normalize or
validate ocp_version before deriving caas_cluster_version so patch-qualified
values such as 4.22.0 do not become 4.22.0.0. Update the caas_cluster_version
configuration to append .0 only for a major.minor value, while preserving the
existing 4.22.0 result for the default.


# CaaS Discovery (boot remaining servers with discovery ISO)
caas_discovery_vm_patterns:
Expand Down
2 changes: 1 addition & 1 deletion infra/netris/roles/create-caas/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
cmd: >-
osac create cluster
--template {{ caas_cluster_template }}
--release-image {{ caas_release_image }}
--version {{ caas_cluster_version }}
-f pull_secret={{ pull_secret_path }}
-f ssh_public_key={{ ssh_public_key_path }}
--name {{ caas_cluster_name }}
Expand Down
Loading