enterprise-contract / ec-cli

Enterprise Contract command line interface
https://enterprisecontract.dev/docs/ec-cli/main/index.html
Apache License 2.0
26 stars 23 forks source link

Handle Index Images with no-platoform manifests #1672

Closed lcarva closed 1 month ago

lcarva commented 1 month ago

When expending an Image Index into Image Manifests, a component is expanded into pseudo components. These are suffixed with the architecture of the particular Image Manifest. However! The manifest descriptor in an Image Index are not required to provide a platform (where the architecture is defined).

Prior to this commit, such Image Indexes would cause a segfault due to a nil pointer exception. This commit resolves that issue by defaulting to a different value if a platform is not specified.

Fixes #1671 Ref: EC-674

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 86.66%. Comparing base (0862dbe) to head (b9ff969).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/graphs/tree.svg?width=650&height=150&src=pr&token=CY5ORXJB33&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract)](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) ```diff @@ Coverage Diff @@ ## main #1672 +/- ## ========================================== + Coverage 79.99% 86.66% +6.66% ========================================== Files 65 76 +11 Lines 4813 5158 +345 ========================================== + Hits 3850 4470 +620 + Misses 963 688 -275 ``` | [Flag](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | Coverage Δ | | |---|---|---| | [acceptance](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `71.77% <0.00%> (?)` | | | [generative](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `80.01% <100.00%> (+0.02%)` | :arrow_up: | | [integration](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `80.01% <100.00%> (+0.02%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | `80.01% <100.00%> (+0.02%)` | :arrow_up: | 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=enterprise-contract#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract) | Coverage Δ | | |---|---|---| | [internal/applicationsnapshot/input.go](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672?src=pr&el=tree&filepath=internal%2Fapplicationsnapshot%2Finput.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract#diff-aW50ZXJuYWwvYXBwbGljYXRpb25zbmFwc2hvdC9pbnB1dC5nbw==) | `93.65% <100.00%> (+0.26%)` | :arrow_up: | ... and [41 files with indirect coverage changes](https://app.codecov.io/gh/enterprise-contract/ec-cli/pull/1672/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=enterprise-contract)