Skip to content

CNF-23046: Migrate away from deprecated ioutil#454

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

CNF-23046: Migrate away from deprecated ioutil#454
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
    • Replaced deprecated file I/O usage with modern standard library calls to remove legacy dependencies and improve maintainability; no user-facing behavior changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 24, 2025

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8a240b6c-04e4-43ea-9ff2-9b4eead8b63b

📥 Commits

Reviewing files that changed from the base of the PR and between fd07510 and 7230d43.

📒 Files selected for processing (2)
  • pkg/cmd/render/render.go
  • pkg/operator/kube_cloud_config/bootstrap.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/operator/kube_cloud_config/bootstrap.go

Walkthrough

Replaced uses of the deprecated io/ioutil package with the os equivalents: ioutil.ReadFileos.ReadFile and ioutil.WriteFileos.WriteFile. Imports updated to remove io/ioutil. No changes to control flow, error handling, or exported declarations.

Changes

I/O API modernization

Layer / File(s) Summary
Imports
pkg/cmd/render/render.go, pkg/operator/kube_cloud_config/bootstrap.go
Removed io/ioutil import and added os where needed.
Read calls
pkg/cmd/render/render.go, pkg/operator/kube_cloud_config/bootstrap.go
Replaced ioutil.ReadFile(...) with os.ReadFile(...) for cluster, infrastructure, and cloud provider reads; error handling unchanged.
Write calls
pkg/cmd/render/render.go
Replaced ioutil.WriteFile(...) with os.WriteFile(...) for writing generated cloud provider config; error handling unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'CNF-23046: Migrate away from deprecated ioutil' clearly and specifically summarizes the main change across both modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 custom check for stable and deterministic Ginkgo test names is not applicable to this PR. The repository uses standard Go testing, not Ginkgo, and this PR makes no test file changes.
Test Structure And Quality ✅ Passed Custom check is not applicable. PR only modifies production code files (render.go, bootstrap.go) to migrate from deprecated ioutil package. No Ginkgo test code is present or modified.
Microshift Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. It only updates two production files to replace deprecated ioutil functions with os equivalents. The MicroShift compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR does not add any Ginkgo e2e tests. Changes are only to non-test source files for ioutil deprecation migration. The SNO test compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR replaces deprecated ioutil calls with os package. No scheduling constraints or topology-related changes. Check not applicable.
Ote Binary Stdout Contract ✅ Passed Changes replace deprecated ioutil with os equivalents in non-entry-point functions. No new process-level stdout writes introduced. Error handling and control flow unchanged.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR refactors existing production code to replace deprecated ioutil calls with os equivalents. No new Ginkgo e2e tests are added, making this check not applicable.

✏️ 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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign p0lyn0mial for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 changed the title Migrate away from deprecated ioutil CNF-23046: Migrate away from deprecated ioutil Apr 20, 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 Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 20, 2026

@sebrandon1: This pull request references CNF-23046 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.

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

Summary by CodeRabbit

  • Chores
  • Modernized internal code by updating file I/O operations to use current standard library APIs, removing usage of deprecated functions and improving codebase maintainability.

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 force-pushed the ioutil_deprecation branch from fd07510 to 7230d43 Compare May 5, 2026 22:34
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 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-ovn-techpreview 7230d43 link true /test e2e-aws-ovn-techpreview

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

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.

2 participants