Skip to content

fix: ensure that all load bundle methods will check the size - #227

Merged
openshift-merge-robot merged 1 commit into
operator-framework:masterfrom
camilamacedo86:fix-bundle-size
Feb 22, 2022
Merged

fix: ensure that all load bundle methods will check the size#227
openshift-merge-robot merged 1 commit into
operator-framework:masterfrom
camilamacedo86:fix-bundle-size

Conversation

@camilamacedo86

@camilamacedo86 camilamacedo86 commented Feb 22, 2022

Copy link
Copy Markdown
Contributor

Description
We need to read all files and compress them to do the check.
By doing checks with SDK we could identify that the loader is not checking the size correctly.

@dinhxuanvu dinhxuanvu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci

openshift-ci Bot commented Feb 22, 2022

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, dinhxuanvu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2022
return err
}

if !info.IsDir() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can flip this conditional by checking if the file we're processing right now is a directory and returning early. This should help reduce nesting and improve readability:

if err != nil {
    return err
}
if info.IsDir() {
    return nil
}

if data, err := os.ReadFile(...); err != nil {
    return err
}
...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do that in a follow-up.

@timflannagan

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2022
@openshift-merge-robot
openshift-merge-robot merged commit bbe9c32 into operator-framework:master Feb 22, 2022
@camilamacedo86
camilamacedo86 deleted the fix-bundle-size branch February 22, 2022 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants