Kuadrant / kuadrant-operator

The Operator to install and manage the lifecycle of the Kuadrant components deployments.
Apache License 2.0
39 stars 33 forks source link

Fix make bundle #998

Closed eguzki closed 1 week ago

eguzki commented 1 week ago

What

bundle makefile phony target does not fail when a referenced bundle image does not exist

This fix makes it fail fast when bundle image does not exist on.

For example, with the changes of this branch, running

make bundle IMG=quay.io/kuadrant/kuadrant-operator:latest VERSION=0.12.0 LIMITADOR_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:unknown AUTHORINO_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/authorino-operator-bundle:unknown DNS_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/dns-operator-bundle:unknown RELATED_IMAGE_WASMSHIM=oci://quay.io/kuadrant/wasm-shim:latest

Note that quay.io/kuadrant/limitador-operator-bundle:unknown does not exist

The resulting error is:

ATH=/home/eguzki/git/kuadrant/kuadrant-operator/bin:$PATH; \
         /home/eguzki/git/kuadrant/kuadrant-operator/utils/update-operator-dependencies.sh limitador-operator quay.io/kuadrant/limitador-operator-bundle:unknown
2024/11/11 11:53:12 render reference "quay.io/kuadrant/limitador-operator-bundle:unknown": error resolving name : quay.io/kuadrant/limitador-operator-bundle:unknown: not found

And the command returns early with the error.

On the other hand, without the changes of this PR (checkout on main branch), running the command:

make bundle IMG=quay.io/kuadrant/kuadrant-operator:latest VERSION=0.12.0 LIMITADOR_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:unknown AUTHORINO_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/authorino-operator-bundle:unknown DNS_OPERATOR_BUNDLE_IMG=quay.io/kuadrant/dns-operator-bundle:unknown RELATED_IMAGE_WASMSHIM=oci://quay.io/kuadrant/wasm-shim:latest

The command still fails, but the error is a bundle validation step

ERRO[0000] error validating format in bundle: Bundle validation errors: Package version is empty,Package version is empty,Package version is empty

Just because the generated bundle is not correct (due to missing bundle image)

eguzki commented 1 week ago

I summon our bash expert for review @mikenairn

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.82%. Comparing base (cc1b41f) to head (e57e427). Report is 19 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #998 +/- ## ========================================== + Coverage 76.15% 83.82% +7.66% ========================================== Files 111 81 -30 Lines 8986 6632 -2354 ========================================== - Hits 6843 5559 -1284 + Misses 1852 860 -992 + Partials 291 213 -78 ``` | [Flag](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | Coverage Δ | | |---|---|---| | [bare-k8s-integration](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `14.64% <ø> (+3.77%)` | :arrow_up: | | [controllers-integration](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `76.22% <ø> (+17.36%)` | :arrow_up: | | [envoygateway-integration](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `41.13% <ø> (+8.63%)` | :arrow_up: | | [gatewayapi-integration](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `16.29% <ø> (+2.85%)` | :arrow_up: | | [istio-integration](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `43.51% <ø> (+9.18%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `17.03% <ø> (-8.34%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | Coverage Δ | | |---|---|---| | [api/v1beta1 (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `90.00% <100.00%> (-2.19%)` | :arrow_down: | | [api/v1beta2 (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `∅ <ø> (∅)` | | | [pkg/common (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `∅ <ø> (∅)` | | | [pkg/istio (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `62.06% <ø> (+15.03%)` | :arrow_up: | | [pkg/log (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `93.18% <ø> (ø)` | | | [pkg/reconcilers (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `24.67% <ø> (∅)` | | | [pkg/rlptools (u)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `∅ <ø> (∅)` | | | [controllers (i)](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant) | `86.64% <91.05%> (+2.21%)` | :arrow_up: | [see 22 files with indirect coverage changes](https://app.codecov.io/gh/Kuadrant/kuadrant-operator/pull/998/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kuadrant)