Skip to content

Commit

Permalink
Merge branch 'EET-3470/redhat-charts-must-have-prefix' into EET-3470-…
Browse files Browse the repository at this point in the history
…MAIN-CONSTRUCTED
  • Loading branch information
komish committed Nov 10, 2023
2 parents f6db590 + 8608480 commit 02707d2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/src/checkprcontent/checkpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def ensure_only_chart_is_modified(api_url, repository, branch):
"category", f"{'partner' if category == 'partners' else category}"
)
gitutils.add_output("organization", organization)
gitutils.add_output("chart-name", chart)

if not semver.VersionInfo.isvalid(version):
msg = (
Expand All @@ -208,6 +209,20 @@ def ensure_only_chart_is_modified(api_url, repository, branch):
gitutils.add_output("pr-content-error-message", msg)
sys.exit(1)

# Red Hat charts must carry the Red Hat prefix.
if organization == "redhat":
if not chart.startswith("redhat-"):
msg = f"[ERROR] Charts provided by Red Hat must have their name begin with the redhat- prefix. I.e. redhat-{chart}"
gitutils.add_output("pr-content-error-message", msg)
sys.exit(1)

# Non Red Hat charts must not carry the Red Hat prefix.
if organization != "redhat" and chart.startswith("redhat-"):
msg = f"[ERROR] The redhat- prefix is reserved for charts provided by Red Hat. Your chart: {chart}"
gitutils.add_output("pr-content-error-message", msg)
sys.exit(1)

# Check the index.yaml for the existence of this chart at this version.
print("Downloading index.yaml", category, organization, chart, version)
r = requests.get(
f"https://raw.githubusercontent.com/{repository}/{branch}/index.yaml"
Expand Down

0 comments on commit 02707d2

Please sign in to comment.