Skip to content

telco-hub: Fix ZTP policy URLs#803

Open
javierpena wants to merge 1 commit into
openshift-kni:mainfrom
javierpena:hub-fix-urls
Open

telco-hub: Fix ZTP policy URLs#803
javierpena wants to merge 1 commit into
openshift-kni:mainfrom
javierpena:hub-fix-urls

Conversation

@javierpena

Copy link
Copy Markdown

The old URLs were pointing to a non-existent path under https://github.com/openshift-kni/cnf-features-deploy/ztp/gitops-subscriptions

@openshift-ci openshift-ci Bot requested review from MarSik and lack June 8, 2026 15:11
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: javierpena
Once this PR has been reviewed and has the lgtm label, please assign imiller0 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Two Argo CD Application manifests are updated to reference a new Git repository and paths. Both clusters-app.yaml and policies-app.yaml change their source configuration from openshift-kni/cnf-features-deploy on master branch to openshift-kni/telco-reference on main, with corresponding path updates under the telco-ran/configuration structure.

Changes

GitOps Application Source Migration

Layer / File(s) Summary
Update Argo CD Application sources to telco-reference
telco-hub/configuration/reference-crs/required/gitops/ztp-installation/clusters-app.yaml, telco-hub/configuration/reference-crs/required/gitops/ztp-installation/policies-app.yaml
Argo CD Application source configuration updated in both clusters-app and policies-app to reference openshift-kni/telco-reference repository on main branch with new telco-ran/configuration/argocd/example/ paths instead of previous openshift-kni/cnf-features-deploy on master with ztp/gitops-subscriptions paths.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'telco-hub: Fix ZTP policy URLs' directly and clearly describes the main change—fixing incorrect ZTP policy URLs in the telco-hub configuration.
Description check ✅ Passed The description is related to the changeset, explaining that old URLs pointed to non-existent paths and the PR corrects those links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between fda0964 and 5c37309.

📒 Files selected for processing (2)
  • telco-hub/configuration/reference-crs/required/gitops/ztp-installation/clusters-app.yaml
  • telco-hub/configuration/reference-crs/required/gitops/ztp-installation/policies-app.yaml

Comment on lines +22 to +24
path: telco-ran/configuration/argocd/example/clusterinstance
repoURL: https://github.com/openshift-kni/telco-reference
targetRevision: main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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:


🏁 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)
PY

Repository: 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)
PY

Repository: 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.

🤖 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.

@MarSik

MarSik commented Jun 16, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants