Skip to content

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

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
sebrandon1:ioutil_deprecation
Mar 28, 2026
Merged

: NO-ISSUE: Migrate away from deprecated ioutil#1160
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
sebrandon1:ioutil_deprecation

Conversation

@sebrandon1
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

tmshort commented Feb 27, 2026

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

@tmshort
Copy link
Copy Markdown
Contributor

tmshort commented Mar 11, 2026

/approve

@openshift-ci
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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: 93a07f36-9c0b-4b6e-8d64-6f19b40259fb

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

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

@tmshort
Copy link
Copy Markdown
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
Copy Markdown

@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.

@bandrade
Copy link
Copy Markdown
Contributor

/label qe-approved
/verified by @bandrade

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Mar 27, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 27, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@bandrade: This PR has been marked as verified by @bandrade.

Details

In response to this:

/label qe-approved
/verified by @bandrade

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.

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 528f824 and 2 for PR HEAD dd3ff27 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 3a864ce into openshift:main Mar 28, 2026
16 checks passed
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. qe-approved Signifies that QE has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants