Skip to content

: NO-ISSUE: Migrate away from deprecated ioutil#1160

Open
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:ioutil_deprecation
Open

: NO-ISSUE: Migrate away from deprecated ioutil#1160
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:ioutil_deprecation

Conversation

@sebrandon1
Copy link
Member

ioutil has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil

Tracking issue: redhat-best-practices-for-k8s/telco-bot#52

Migration from ioutil to os for file and directory operations:

  • Replaced ioutil.ReadFile with os.ReadFile and ioutil.ReadDir with os.ReadDir in core configuration and bundle loading logic, such as in pkg/profiling/config/config.go and staging/api/pkg/manifests/bundleloader.go. [1] [2] [3] [4]

  • Updated validation and testing files to use os.ReadFile instead of ioutil.ReadFile, including files like staging/api/pkg/validation/internal/community.go, crd_test.go, csv_test.go, object_test.go, and operatorgroup_test.go. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

  • Updated additional internal and registry logic to use os.ReadFile, os.WriteFile, and os.MkdirTemp in place of their ioutil counterparts, such as in operatorhub.go, buildahregistry/_options.go, and provisioner_kind.go. [1] [2] [3] [4] [5] [6]

@perdasilva
Copy link
Contributor

@sebrandon1 thanks so much for this!

Unfortunately, the changes done under the staging directory need to happen upstream first and then get downstreamed.
I've created two PRs:

that bring your proposed changes to the upstream components.

Could you please revert the changes under staging and just check in the pkg/profiling/config changes?

@tmshort
Copy link
Contributor

tmshort commented Feb 27, 2026

@sebrandon1 please consider rebasing this change to fix issues in the pkg directory.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 28, 2026

@sebrandon1: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@tmshort
Copy link
Contributor

tmshort commented Mar 11, 2026

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sebrandon1, tmshort

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 Mar 11, 2026
@tmshort
Copy link
Contributor

tmshort commented Mar 16, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a84cebc0-b4e3-417f-bf06-b03841d9c7ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@tmshort
Copy link
Contributor

tmshort commented Mar 18, 2026

/retitle: NO-ISSUE: Migrate away from deprecated ioutil

@openshift-ci openshift-ci bot changed the title Migrate away from deprecated ioutil : NO-ISSUE: Migrate away from deprecated ioutil Mar 18, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 18, 2026
@openshift-ci-robot
Copy link

@sebrandon1: This pull request explicitly references no jira issue.

Details

In response to this:

ioutil has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil

Tracking issue: redhat-best-practices-for-k8s/telco-bot#52

Migration from ioutil to os for file and directory operations:

  • Replaced ioutil.ReadFile with os.ReadFile and ioutil.ReadDir with os.ReadDir in core configuration and bundle loading logic, such as in pkg/profiling/config/config.go and staging/api/pkg/manifests/bundleloader.go. [1] [2] [3] [4]

  • Updated validation and testing files to use os.ReadFile instead of ioutil.ReadFile, including files like staging/api/pkg/validation/internal/community.go, crd_test.go, csv_test.go, object_test.go, and operatorgroup_test.go. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

  • Updated additional internal and registry logic to use os.ReadFile, os.WriteFile, and os.MkdirTemp in place of their ioutil counterparts, such as in operatorhub.go, buildahregistry/_options.go, and provisioner_kind.go. [1] [2] [3] [4] [5] [6]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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