Skip to content

Commit

Permalink
Temporary fix for sbom generation for metrics-server (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayoz authored Nov 11, 2024
1 parent a741eaa commit f6ef548
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions build-scripts/hack/generate-sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ def rock_coredns(manifest, extra_files):
"revision": rock_repo_commit,
},
"language": "go",
"details": ["coredns/1.11.1/rockcraft.yaml", "coredns/go.mod", "coredns/go.sum"],
"details": [
"coredns/1.11.1/rockcraft.yaml",
"coredns/go.mod",
"coredns/go.sum",
],
"source": {
"type": "git",
"repo": repo_url,
Expand All @@ -227,9 +231,10 @@ def rock_metrics_server(manifest, extra_files):

with util.git_repo(METRICS_SERVER_ROCK_REPO, METRICS_SERVER_ROCK_TAG) as d:
rock_repo_commit = util.parse_output(["git", "rev-parse", "HEAD"], cwd=d)
rockcraft = (d / "rockcraft.yaml").read_text()
# TODO(ben): This should not be hard coded.
rockcraft = (d / "0.7.0/rockcraft.yaml").read_text()

extra_files["metrics-server/rockcraft.yaml"] = rockcraft
extra_files["metrics-server/0.7.0/rockcraft.yaml"] = rockcraft

rockcraft_yaml = yaml.safe_load(rockcraft)
repo_url = rockcraft_yaml["parts"]["metrics-server"]["source"]
Expand All @@ -249,7 +254,7 @@ def rock_metrics_server(manifest, extra_files):
},
"language": "go",
"details": [
"metrics-server/rockcraft.yaml",
"metrics-server/0.7.0/rockcraft.yaml",
"metrics-server/go.mod",
"metrics-server/go.sum",
],
Expand Down

0 comments on commit f6ef548

Please sign in to comment.