Skip to content

CNF-23047: Migrate away from deprecated ioutil#1072

Open
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:ioutil_deprecation
Open

CNF-23047: Migrate away from deprecated ioutil#1072
sebrandon1 wants to merge 1 commit into
openshift: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
    • Modernized internal file-reading and cleaned up imports to remove deprecated usage; no behavioral changes or public API impact.
  • Tests
    • Updated end-to-end metrics test to use current reading APIs and refreshed imports so tests align with the modernized code.

@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

@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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: b82dcf7b-54f0-414c-b0f5-b8cf5ce9b6e5

📥 Commits

Reviewing files that changed from the base of the PR and between 4b964f3 and 3a506f3.

📒 Files selected for processing (2)
  • test/e2e/metrics_test.go
  • tools/import-verifier/import-verifier.go
✅ Files skipped from review due to trivial changes (1)
  • tools/import-verifier/import-verifier.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/metrics_test.go

Walkthrough

The code replaces deprecated ioutil calls with modern equivalents: tests use io.ReadAll; the import verifier uses os.ReadFile and drops the unused io/ioutil import. No control flow or public APIs changed.

Changes

I/O modernization

Layer / File(s) Summary
Metrics test: use io.ReadAll
test/e2e/metrics_test.go
Added io import and replaced ioutil.ReadAll(resp.Body) with io.ReadAll(resp.Body) in the metrics E2E test.
Import verifier: use os.ReadFile
tools/import-verifier/import-verifier.go
Removed io/ioutil import and replaced ioutil.ReadFile(configFile) with os.ReadFile(configFile) in loadImportRestrictions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and does not follow the required template structure with sections like Analysis/Root cause, Solution description, Test setup, Test cases, Browser conformance, etc. Expand the description to follow the repository template: add Analysis/Root cause, detailed Solution description, Test setup, Test cases, and other required sections.
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 (13 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating away from the deprecated ioutil package.
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 check for stable and deterministic Ginkgo test names is not applicable. The PR changes files using standard Go testing framework (testing.T), not Ginkgo framework.
Test Structure And Quality ✅ Passed The PR contains no Ginkgo tests. Both modified files use standard Go testing, not Ginkgo's BDD framework. The check is not applicable to this refactoring PR.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added. PR only modernizes deprecated ioutil calls to standard library equivalents without changing test logic or adding new tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added. Changes only migrate deprecated ioutil functions to modern equivalents (os.ReadFile, io.ReadAll) in existing code.
Topology-Aware Scheduling Compatibility ✅ Passed PR replaces deprecated Go ioutil functions in a utility tool and test file; contains no deployment manifests, scheduling constraints, or topology-related code.
Ote Binary Stdout Contract ✅ Passed PR migrates deprecated ioutil functions to modern alternatives (os.ReadFile, io.ReadAll) with no stdout behavior changes. Not applicable as repository is not an OTE binary extension.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests added. PR only refactors existing code by replacing deprecated ioutil APIs with non-deprecated equivalents, which does not affect IPv6/network compatibility.
No-Weak-Crypto ✅ Passed PR migrates from deprecated ioutil to standard Go packages (os.ReadFile, io.ReadAll). No weak crypto patterns detected.
Container-Privileges ✅ Passed PR only modifies Go source files updating deprecated ioutil to modern stdlib; no container/K8s manifests with privileged security settings present.
No-Sensitive-Data-In-Logs ✅ Passed PR migrates from deprecated ioutil to modern stdlib functions. No new logging introduced; existing logs only contain error messages and status codes, not sensitive data.

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

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

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

@sebrandon1
Copy link
Copy Markdown
Member Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 4, 2026
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch 2 times, most recently from 66da564 to d8a2084 Compare May 18, 2026 20:52
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch from d8a2084 to 4b964f3 Compare May 29, 2026 14:59
@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch from 4b964f3 to 3a506f3 Compare June 1, 2026 20:37
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 1, 2026

@sebrandon1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn 3a506f3 link true /test e2e-gcp-ovn

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.

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