1
0
Fork 0

Keep track of where check results originated from

This commit is contained in:
Maurizio Porrato 2023-08-12 15:57:05 +01:00
parent 8d5fde5fcd
commit b0f6bea925
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,9 @@ def check_operator_name(bundle: Bundle) -> Iterator[CheckResult]:
"""Check if the operator names used in CSV, metadata and filesystem are consistent"""
name = bundle.annotations.get("operators.operatorframework.io.bundle.package.v1")
if name is None:
yield Fail(f"Bundle does not define the operator name in annotations.yaml")
yield Fail(
bundle, f"Bundle does not define the operator name in annotations.yaml"
)
return
if name != bundle.csv_operator_name:
yield Fail(

View File

@ -18,7 +18,7 @@ def check_upgrade(operator: Operator) -> Iterator[CheckResult]:
if dangling_bundles:
yield Fail(
operator,
f"Channel {channel} has dangling bundles: {dangling_bundles}.",
f"Channel {channel} has dangling bundles: {dangling_bundles}",
)
except Exception as exc:
yield Fail(operator, str(exc))