Skip to content

Commit 0fb9627

Browse files
authored
fix: updates for olm 24.11.1 (#96)
* ensure the image manifest list is used * remove the olm.skipRange annotation
1 parent 0ca3008 commit 0fb9627

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

olm/build-manifests.py

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,9 @@ def write_manifests(args: argparse.Namespace, manifests: list[dict]) -> None:
335335
# The other objects are embedded in the CSV. These are:
336336
# - the operator cluster role (N.B. some products have more than one cluster role e.g. HDFS)
337337
# - the operator deployment
338-
elif (
339-
m["kind"] == "ClusterRole"
340-
and (
341-
m["metadata"]["name"] == f"{args.product}-clusterrole"
342-
or m["metadata"]["name"] == f"{args.product}-clusterrole-nodes"
343-
)
338+
elif m["kind"] == "ClusterRole" and (
339+
m["metadata"]["name"] == f"{args.product}-clusterrole"
340+
or m["metadata"]["name"] == f"{args.product}-clusterrole-nodes"
344341
):
345342
dest_file = (
346343
args.dest_dir / "manifests" / f"{m['metadata']['name']}.yaml"
@@ -428,7 +425,9 @@ def generate_csv(
428425
result["metadata"]["annotations"]["repository"] = (
429426
f"https://github.com/stackabletech/{args.op_name}"
430427
)
431-
result["metadata"]["annotations"]["olm.skipRange"] = f'< {args.release}'
428+
429+
# Commented out as it caused problems with the certification pipeline.
430+
# result["metadata"]["annotations"]["olm.skipRange"] = f'< {args.release}'
432431

433432
### 1. Add list of owned crds
434433
result["spec"]["customresourcedefinitions"]["owned"] = owned_crds
@@ -542,7 +541,7 @@ def generate_crds(repo_operator: pathlib.Path) -> list[dict]:
542541
del crd["metadata"]["annotations"]["helm.sh/resource-policy"]
543542
else:
544543
raise ManifestException(
545-
f'Expected "CustomResourceDefinition" but found kind "{crd['kind']}" in CRD file "{crd_path}"'
544+
f'Expected "CustomResourceDefinition" but found kind "{crd["kind"]}" in CRD file "{crd_path}"'
546545
)
547546
logging.debug("finish generate_crds")
548547
return crds
@@ -565,11 +564,24 @@ def quay_image(images: list[tuple[str, str]]) -> list[dict[str, str]]:
565564
)
566565

567566
manifest_digest = [
568-
t["manifest_digest"] for t in data["tags"] if t["name"] == release
569-
][0]
567+
t["manifest_digest"]
568+
for t in data["tags"]
569+
if t["name"] == release and t["is_manifest_list"] == True
570+
]
571+
572+
if len(manifest_digest) == 0:
573+
raise ManifestException(f"No manifest list for {image}:{release} found")
574+
575+
if len(manifest_digest) > 1:
576+
raise ManifestException(
577+
f"Multiple manifest lists for {image}:{release} found but only one expected"
578+
)
570579

571580
result.append(
572-
{"name": image, "image": f"quay.io/stackable/{image}@{manifest_digest}"}
581+
{
582+
"name": image,
583+
"image": f"quay.io/stackable/{image}@{manifest_digest[0]}",
584+
}
573585
)
574586
logging.debug("finish op_image")
575587
return result
@@ -597,7 +609,9 @@ def write_metadata(args: argparse.Namespace) -> None:
597609
annos["annotations"][
598610
"operators.operatorframework.io.bundle.channel.default.v1"
599611
] = args.channel
600-
annos["annotations"]["operators.operatorframework.io.bundle.channels.v1"] = f"stable,{args.channel}"
612+
annos["annotations"]["operators.operatorframework.io.bundle.channels.v1"] = (
613+
f"stable,{args.channel}"
614+
)
601615

602616
anno_file = metadata_dir / "annotations.yaml"
603617
logging.info(f"Writing {anno_file}")

olm/resources/csv.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ metadata:
2525
description: Stackable Operator for placeholder
2626
repository: https://github.com/stackabletech/placeholder
2727
containerImage: placeholder
28-
olm.skipRange: placeholder
2928
spec:
3029
displayName: placeholder
3130
description: |

0 commit comments

Comments
 (0)