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 calls with modern standard library equivalents to remove a legacy dependency and improve maintainability; internal-only change with no user-facing behavior differences.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 24, 2025

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

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 & render updates
pkg/cmd/render/render.go
Removed io/ioutil import; replaced ioutil.ReadFile(...) with os.ReadFile(...) and ioutil.WriteFile(...) with os.WriteFile(...) in the render command; behavior and error handling unchanged.
Bootstrap transform updates
pkg/operator/kube_cloud_config/bootstrap.go
Removed io/ioutil import; replaced ioutil.ReadFile(...) with os.ReadFile(...) for infrastructure and optional cloud provider file reads; behavior and error handling unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: migrating away from the deprecated ioutil package, which is the primary focus across all 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 PR modifies only production code files (render.go and bootstrap.go). These are not test files and don't contain Ginkgo tests, so the test naming check is not applicable.
Test Structure And Quality ✅ Passed PR only modifies production code (render.go, bootstrap.go) replacing deprecated ioutil with os APIs; no Ginkgo test files modified, so test quality check is not applicable.
Microshift Test Compatibility ✅ Passed PR does not add new Ginkgo e2e tests; changes are only code refactoring in non-test files, replacing deprecated ioutil calls with os equivalents.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds no new Ginkgo e2e tests. Changes are code refactoring to remove deprecated ioutil imports (production code only), making the SNO compatibility check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR only removes deprecated io/ioutil imports and updates file I/O to os.ReadFile/WriteFile. No deployment manifests, controllers, or scheduling constraints are added or modified.
Ote Binary Stdout Contract ✅ Passed PR only replaces deprecated ioutil with os equivalents for file I/O; makes no changes to process-level code or stdout writes, so cannot violate OTE Binary Stdout Contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests added. PR only refactors file I/O in two utility modules to replace deprecated ioutil with os equivalents.
No-Weak-Crypto ✅ Passed The PR only modifies file I/O operations (replacing deprecated ioutil with os package), containing no weak cryptographic algorithms, custom crypto, or insecure secret comparisons.
Container-Privileges ✅ Passed PR only modifies Go source files (ioutil deprecation migration), not container/K8s manifests. Container privilege check is not applicable to Go code changes.
No-Sensitive-Data-In-Logs ✅ Passed The PR replaces deprecated ioutil with os functions without changing error handling. Error messages only log file paths and OS errors, not sensitive content or credentials.

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

@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch from 7230d43 to 256442b Compare May 29, 2026 14:59
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 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 force-pushed the ioutil_deprecation branch from 256442b to ae525b0 Compare June 1, 2026 20:37
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