telco-hub: Fix ZTP policy URLs#803
Conversation
The old URLs were pointing to a non-existent path under https://github.com/openshift-kni/cnf-features-deploy/ztp/gitops-subscriptions
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: javierpena The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @javierpena. Thanks for your PR. I'm waiting for a openshift-kni member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
📝 WalkthroughWalkthroughTwo Argo CD Application manifests are updated to reference a new Git repository and paths. Both ChangesGitOps Application Source Migration
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In
`@telco-hub/configuration/reference-crs/required/gitops/ztp-installation/clusters-app.yaml`:
- Around line 22-24: Verify that the ArgoCD application fields path, repoURL,
and targetRevision point to an existing repo subtree: check that
https://github.com/openshift-kni/telco-reference at targetRevision "main"
contains the directory telco-ran/configuration/argocd/example/clusterinstance
and that this directory includes the expected ClusterInstance and related
manifests; if it does not exist or is empty, update the "path" to the correct
directory or change "repoURL"/"targetRevision" to the repo/revision that
actually contains the required manifests so the ZTP installer can consume them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 433d2efc-1532-48e6-8904-2d14186b3094
📒 Files selected for processing (2)
telco-hub/configuration/reference-crs/required/gitops/ztp-installation/clusters-app.yamltelco-hub/configuration/reference-crs/required/gitops/ztp-installation/policies-app.yaml
| path: telco-ran/configuration/argocd/example/clusterinstance | ||
| repoURL: https://github.com/openshift-kni/telco-reference | ||
| targetRevision: main |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that the new repository and paths exist
echo "=== Checking repository accessibility ==="
curl -s -o /dev/null -w "%{http_code}" https://github.com/openshift-kni/telco-reference
echo -e "\n\n=== Checking if path exists in main branch ==="
curl -s "https://api.github.com/repos/openshift-kni/telco-reference/contents/telco-ran/configuration/argocd/example/clusterinstance?ref=main" | jq -r 'if type=="array" then "✓ Path exists with \(length) items" elif .message then "✗ Error: \(.message)" else "✓ Path exists" end'
echo -e "\n=== Listing contents at clusterinstance path ==="
curl -s "https://api.github.com/repos/openshift-kni/telco-reference/contents/telco-ran/configuration/argocd/example/clusterinstance?ref=main" | jq -r 'if type=="array" then .[] | " - \(.name) (\(.type))" else .message end'Repository: openshift-kni/telco-reference
Length of output: 159
🏁 Script executed:
#!/bin/bash
set -euo pipefail
REPO="openshift-kni/telco-reference"
REF="main"
PATH="telco-ran/configuration/argocd/example/clusterinstance"
echo "=== Checking repository accessibility (tight timeouts) ==="
curl -L --connect-timeout 10 --max-time 20 -s -o /dev/null -w "HTTP %{http_code}\n" "https://github.com/${REPO}"
echo "=== Checking if path exists in ${REF} branch (GitHub contents API) ==="
API="https://api.github.com/repos/${REPO}/contents/${PATH}?ref=${REF}"
curl -L --connect-timeout 10 --max-time 20 -sS -H "Accept: application/vnd.github+json" "$API" \
| jq -r '
if type=="array" then "✓ Path exists (items: \(length))"
elif .message then "✗ GitHub API error: \(.message)"
else "✓ Path exists (unexpected response)"
end'
echo "=== Listing contents at ${PATH} (if it’s a directory) ==="
curl -L --connect-timeout 10 --max-time 20 -sS -H "Accept: application/vnd.github+json" "$API" \
| jq -r 'if type=="array" then .[] | " - \(.name) (\(.type))" else .message end'Repository: openshift-kni/telco-reference
Length of output: 195
🌐 Web query:
openshift-kni/telco-reference telco-ran/configuration/argocd/example/clusterinstance
💡 Result:
The path telco-ran/configuration/argocd/example/clusterinstance refers to a standard directory structure used in GitOps Zero Touch Provisioning (ZTP) workflows for Red Hat OpenShift, particularly within telecommunications and edge computing reference implementations [1]. This directory path is typically found within Git repositories designed to manage cluster deployments via ArgoCD and the Red Hat Advanced Cluster Management (RHACM) framework [1]. Its primary purpose is to store reference examples of Custom Resources (CRs) required for automated cluster provisioning and configuration [1]: 1. ClusterInstance CRs: These define the declarative state for managed cluster installations, replacing the older SiteConfig API [2][3][1]. 2. PolicyGenerator or PolicyGenTemplate CRs: These are used to generate and apply configuration policies to the clusters automatically upon deployment [2][3][1]. The openshift-kni/telco-reference repository provides these reference designs, which serve as blueprints for users to build their own GitOps repository structures [4][5][1]. In production ZTP environments, developers and operators use the directory structure under argocd/example as a template [1]. By placing ClusterInstance and PolicyGenerator CRs in this structured path, users ensure that their ArgoCD applications can correctly discover and synchronize the deployment state of edge clusters (e.g., SNOs, three-node clusters, or standard clusters) [2][1]. Documentation often directs users to reference this specific directory to understand the required hierarchy for "Day 0" and "Day 1" configurations, including the integration of extra manifests and hardware profiles [6][7][1].
Citations:
- 1: https://docs.okd.io/4.21/edge_computing/ztp-preparing-the-hub-cluster.html
- 2: https://docs.okd.io/latest/scalability_and_performance/telco-ran-du-rds.html
- 3: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/scalability_and_performance/telco-ran-du-ref-design-specs
- 4: https://github.com/openshift-kni/telco-reference
- 5: https://validatedpatterns.io/patterns/telco-hub/
- 6: https://github.com/openshift-kni/oran-o2ims/blob/main/docs/user-guide/gitops-layout-and-setup.md
- 7: https://github.com/openshift-kni/oran-o2ims/blob/main/docs/user-guide/template-overview.md
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
import json, urllib.request, urllib.error
REPO="openshift-kni/telco-reference"
REF="main"
PATH="telco-ran/configuration/argocd/example/clusterinstance"
def gh_get(url):
req = urllib.request.Request(url, headers={"Accept":"application/vnd.github+json", "User-Agent":"repo-path-verifier"})
try:
with urllib.request.urlopen(req, timeout=20) as resp:
data = resp.read().decode("utf-8")
return resp.status, json.loads(data)
except urllib.error.HTTPError as e:
body = e.read().decode("utf-8","ignore") if hasattr(e, "read") else ""
try:
return e.code, json.loads(body) if body else {"error": body}
except Exception:
return e.code, {"error": body.strip()[:500]}
except Exception as e:
return None, {"error": str(e)}
base_url=f"https://api.github.com/repos/{REPO}"
repo_status, _ = gh_get(base_url)
print(f"=== Checking repository accessibility: HTTP {repo_status} ===")
contents_url=f"{base_url}/contents/{PATH}?ref={REF}"
status, data = gh_get(contents_url)
print(f"=== Checking if path exists in {REF}: HTTP {status} ===")
if status and 200 <= status < 300:
if isinstance(data, list):
print(f"✓ Path exists as directory; items: {len(data)}")
for item in data[:30]:
print(f" - {item.get('name')} ({item.get('type')})")
if len(data) > 30:
print(f" ... ({len(data)-30} more)")
elif isinstance(data, dict):
t=data.get("type")
print(f"✓ Path exists as {t}")
print(" - name:", data.get("name"))
print(" - sha:", data.get("sha"))
else:
print("✓ Path exists (unexpected JSON type)")
else:
msg = ""
if isinstance(data, dict):
msg = data.get("message") or data.get("error") or ""
print("✗ Path check failed:", msg)
PYRepository: openshift-kni/telco-reference
Length of output: 224
🏁 Script executed:
#!/bin/bash
set -euo pipefail
REPO="openshift-kni/telco-reference"
REF="main"
PATH="telco-ran/configuration/argocd/example/clusterinstance"
python3 - <<'PY'
import json, sys, urllib.request, urllib.error
REPO="openshift-kni/telco-reference"
REF="main"
PATH="telco-ran/configuration/argocd/example/clusterinstance"
def gh_get(url):
req = urllib.request.Request(url, headers={"Accept":"application/vnd.github+json","User-Agent":"ztp-path-check"})
with urllib.request.urlopen(req, timeout=20) as resp:
return resp.status, json.loads(resp.read().decode("utf-8"))
repo_url=f"https://api.github.com/repos/{REPO}"
contents_url=f"{repo_url}/contents/{PATH}?ref={REF}"
try:
status, _ = gh_get(repo_url)
print(f"=== Repo: {REPO} accessible (HTTP {status}) ===")
except Exception as e:
print(f"=== Repo accessibility failed ===\n{e}")
sys.exit(1)
try:
status, data = gh_get(contents_url)
print(f"=== Path exists in {REF} (HTTP {status}) ===")
except urllib.error.HTTPError as e:
body = e.read().decode("utf-8","ignore") if hasattr(e, "read") else ""
print(f"=== Path check failed (HTTP {e.code}) ===")
print(body[:1000])
sys.exit(1)
if isinstance(data, list):
print(f"✓ Directory: {PATH} (items: {len(data)})")
for item in data:
print(f" - {item.get('name')} ({item.get('type')})")
else:
print(f"✗ Unexpected response type: {type(data)}")
print(json.dumps(data, indent=2)[:1000])
sys.exit(1)
PYRepository: openshift-kni/telco-reference
Length of output: 121
Ensure the referenced telco-reference path exists on main (ZTP source-path integrity).
The ZTP/ArgoCD installation will fail if repoURL=https://github.com/openshift-kni/telco-reference at targetRevision=main does not contain telco-ran/configuration/argocd/example/clusterinstance.
path: telco-ran/configuration/argocd/example/clusterinstance
repoURL: https://github.com/openshift-kni/telco-reference
targetRevision: main
Comment
Verify that the new repository paths exist and contain expected resources.
- Confirm the directory exists and is accessible at: https://github.com/openshift-kni/telco-reference/tree/main/telco-ran/configuration/argocd/example/clusterinstance
- Ensure the directory includes the expected ClusterInstance / related manifests your ZTP installer consumes (not an empty/moved placeholder).
🤖 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
`@telco-hub/configuration/reference-crs/required/gitops/ztp-installation/clusters-app.yaml`
around lines 22 - 24, Verify that the ArgoCD application fields path, repoURL,
and targetRevision point to an existing repo subtree: check that
https://github.com/openshift-kni/telco-reference at targetRevision "main"
contains the directory telco-ran/configuration/argocd/example/clusterinstance
and that this directory includes the expected ClusterInstance and related
manifests; if it does not exist or is empty, update the "path" to the correct
directory or change "repoURL"/"targetRevision" to the repo/revision that
actually contains the required manifests so the ZTP installer can consume them.
|
/ok-to-test |
The old URLs were pointing to a non-existent path under https://github.com/openshift-kni/cnf-features-deploy/ztp/gitops-subscriptions