Add bundle size validation - #163
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bentito The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| @@ -95,6 +97,14 @@ func validateBundleOperatorHub(bundle *manifests.Bundle, k8sVersion string) erro | |||
| return result | |||
| } | |||
There was a problem hiding this comment.
Would that be possible?
- We have an attr https://github.com/operator-framework/api/blob/master/pkg/manifests/bundleloader.go#L20 for the size?
- when we load we set the size
- Is the size criteria for ANY bundle built? Is that a limitation for OLM no matter o what? If yes, wdyt about we check it in the BundleValidator https://github.com/operator-framework/api/blob/master/pkg/validation/internal/bundle.go#L28
Also, note that we need to cover the implementations with unit tests as it is done in _test.go files to ensure the checks.
| func checkBundleSize(bundle *manifests.Bundle) BundleChecks { | ||
| // Crawl the bundle, mounted at ./bundle, and add up the bytes | ||
| checks := BundleChecks{errs: []error{}, warns: []error{}} | ||
| bundleDir := "." // pretty sure this isn't right, but how to get bundle path from bundle? |
There was a problem hiding this comment.
The bundle is load here:
api/pkg/manifests/bundleloader.go
Lines 32 to 46 in b512869
bundleDir := "."
Initial take on adding a validation of the bundle size. Please let me know how it is wrong ;-)