Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce afero to simplify FS operations #786

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

bcrochet
Copy link
Contributor

  • Introduce afero in the artificts package
  • Redo the signature of artifacts.WriteFile to accept a reader instead of a string. Updates all locations of WriteFile
  • Rework a test that wasn't properly checking for failure in its BeforeEach

This proves the concept. More work can be done to use afero in unit tests to make them simpler.

Signed-off-by: Brad P. Crochet brad@redhat.com

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

Just a few comments. Overall, it looks good.

I don't know enough about afero to determine exactly how it's interacting with the underlying FS on a given system, but at the API level, the logic LGTM.

* Introduce afero in the artificts package
* Redo the signature of artifacts.WriteFile to accept a reader instead
  of a string. Updates all locations of WriteFile
* Rework a test that wasn't properly checking for failure in its
  BeforeEach

This proves the concept. More work can be done to use afero in unit
tests to make them simpler.

Signed-off-by: Brad P. Crochet <brad@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2022
@openshift-ci
Copy link

openshift-ci bot commented Sep 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21, bcrochet, komish

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [acornett21,bcrochet,komish]

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

@acornett21 acornett21 merged commit bad1155 into redhat-openshift-ecosystem:main Sep 22, 2022
@bcrochet bcrochet deleted the use-afero branch June 6, 2023 17:00
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