Skip to content

CNF-23047: Migrate away from deprecated ioutil#1072

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

CNF-23047: Migrate away from deprecated ioutil#1072
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:ioutil_deprecation

Conversation

@sebrandon1
Copy link
Copy Markdown
Member

@sebrandon1 sebrandon1 commented Nov 24, 2025

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

Summary by CodeRabbit

  • Chores
    • Updated internal development tooling to use modern dependencies.

@openshift-ci openshift-ci Bot requested review from jhadvig and spadgett November 24, 2025 18:12
@jhadvig jhadvig changed the title Migrate away from deprecated ioutil NO-JIRA: (chore) Migrate away from deprecated ioutil Jan 8, 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 Jan 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@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

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.

Copy link
Copy Markdown
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Jan 8, 2026

/override ci/prow/e2e-gcp-ovn

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 8, 2026

@jhadvig: Overrode contexts on behalf of jhadvig: ci/prow/e2e-gcp-ovn

Details

In response to this:

/override ci/prow/e2e-gcp-ovn

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.

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2026
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Mar 4, 2026

/retest

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Apr 2, 2026

/verified by CI
/lgtm

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 2, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@jhadvig: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI
/lgtm

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 openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@jhadvig jhadvig added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Apr 2, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD b9608d2 and 2 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 4bd76c3 and 1 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f061939 and 0 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/hold

Revision 334e8b8 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 7, 2026
@openshift-bot
Copy link
Copy Markdown
Contributor

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@openshift-bot: This pull request explicitly references no jira issue.

Retaining the jira/valid-bug label as it was manually added.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 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.

@sebrandon1 sebrandon1 changed the title NO-JIRA: (chore) Migrate away from deprecated ioutil CNF-23047: Migrate away from deprecated ioutil Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 20, 2026

@sebrandon1: This pull request references CNF-23047 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Retaining the jira/valid-bug label as it was manually added.

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

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 openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Apr 30, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

New changes are detected. LGTM label has been removed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 97aed712-668b-43e1-8f62-8800ca508aff

📥 Commits

Reviewing files that changed from the base of the PR and between 5ced247 and 5e5e76f.

⛔ Files ignored due to path filters (1)
  • test/e2e/metrics_test.go is excluded by !**/*_test.go
📒 Files selected for processing (1)
  • tools/import-verifier/import-verifier.go
📜 Recent review details
🔇 Additional comments (1)
tools/import-verifier/import-verifier.go (1)

305-305: LGTM! Correct migration from deprecated ioutil.

The change from ioutil.ReadFile to os.ReadFile correctly addresses the deprecation of the io/ioutil package in Go 1.16+. The function signatures are identical, maintaining the same behavior while using the modern API.


Walkthrough

The change modernizes file reading by replacing the deprecated io/ioutil.ReadFile call with os.ReadFile in the loadImportRestrictions function. The unused import is removed, with no modifications to control flow or logic.

Changes

Cohort / File(s) Summary
Deprecated Import Removal
tools/import-verifier/import-verifier.go
Replaced ioutil.ReadFile with os.ReadFile and removed unused io/ioutil import for API modernization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It lacks required sections from the template such as Analysis/Root cause, Solution description, Test setup, Test cases, Browser conformance, and Reviewers/assignees. Add the missing required sections from the description template: Analysis/Root cause, Solution description, Test setup, Test cases, Browser conformance, and Reviewers/assignees information.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically refers to the main change: migrating away from the deprecated ioutil package, which is exactly what the pull request does.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR modifies tools/import-verifier/import-verifier.go, a utility tool file with no Ginkgo test code. The modernization from ioutil.ReadFile to os.ReadFile does not affect any Ginkgo tests.
Test Structure And Quality ✅ Passed The custom check for Test Structure and Quality is not applicable to this PR as it modifies a utility tool, not Ginkgo test code.
Microshift Test Compatibility ✅ Passed This PR modernizes a utility tool file by replacing deprecated ioutil.ReadFile with os.ReadFile, containing no Ginkgo e2e test additions, so the check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. The changes are limited to tools/import-verifier/import-verifier.go, a maintenance utility tool.
Topology-Aware Scheduling Compatibility ✅ Passed The pull request modifies a utility tool (import-verifier.go) that verifies import restrictions. The change replaces a deprecated Go standard library function (ioutil.ReadFile) with its modern equivalent (os.ReadFile), which is purely a code modernization effort with no impact on topology-aware scheduling, pod placement, node affinity, or any OpenShift scheduling concerns.
Ote Binary Stdout Contract ✅ Passed The PR replaces deprecated ioutil.ReadFile with os.ReadFile in the loadImportRestrictions function without altering control flow or logic, introducing no stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies tools/import-verifier/import-verifier.go, an internal build tool, with no Ginkgo e2e tests added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 1/10 review remaining, refill in 50 minutes and 45 seconds.

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

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants