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 to remove deprecated APIs and tidy imports; no behavioral or public API changes.
  • Tests
    • Updated end-to-end metrics test to use current reading APIs and imports to match 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

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: 15273108-f569-4002-b641-4490f9d8e5f2

📥 Commits

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

📒 Files selected for processing (2)
  • test/e2e/metrics_test.go
  • tools/import-verifier/import-verifier.go
✅ Files skipped from review due to trivial changes (2)
  • test/e2e/metrics_test.go
  • tools/import-verifier/import-verifier.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. It lacks required sections such as Analysis/Root cause, Solution description, Test setup, Test cases, Browser conformance, and Reviewers/assignees. Fill out all required sections from the template, particularly Analysis/Root cause, Solution description, Test setup, Test cases, and Reviewers/assignees 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 concisely summarizes the main change: migrating away from the deprecated ioutil package. It directly relates to the file-level summaries which show replacing ioutil functions with their modern equivalents.
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 PR contains no Ginkgo tests; uses standard Go testing. Only changes are import/function modernization (ioutil → os/io), not test names.
Test Structure And Quality ✅ Passed The PR only modifies non-Ginkgo code: a standard Go testing file using testing.T and a utility tool. No Ginkgo tests are present or modified, making the custom check not applicable.
Microshift Test Compatibility ✅ Passed PR does not add any new Ginkgo e2e tests. Changes only update existing code by migrating from deprecated ioutil package to modern alternatives (os.ReadFile, io.ReadAll).
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes are limited to updating deprecated ioutil imports to os/io in existing code files.
Topology-Aware Scheduling Compatibility ✅ Passed PR only refactors deprecated Go stdlib calls (ioutil→os/io) in a dev tool and test file; no deployment manifests, controllers, or scheduling constraints are modified.
Ote Binary Stdout Contract ✅ Passed PR replaces deprecated ioutil calls with modern equivalents (os.ReadFile, io.ReadAll). No stdout writes introduced in process-level code or test suite setup.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies existing code to migrate away from deprecated ioutil package. No new Ginkgo e2e tests are added; check applies only to new tests.
No-Weak-Crypto ✅ Passed No weak crypto, custom crypto implementations, or non-constant-time secret comparisons found. Changes only replace deprecated ioutil APIs with modern alternatives.
Container-Privileges ✅ Passed PR only modifies Go source files to migrate from deprecated ioutil package. No changes to container security configs, privilege settings, or K8s manifests affecting privileged mode or host access.
No-Sensitive-Data-In-Logs ✅ Passed PR only modernizes deprecated ioutil functions (os.ReadFile, io.ReadAll) without adding any logging statements or sensitive data exposure.

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

openshift-ci Bot commented May 29, 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-aws-console 4b964f3 link true /test e2e-aws-console

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