Skip to content

CNF-23050: Migrate away from deprecated ioutil#295

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

CNF-23050: Migrate away from deprecated ioutil#295
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

Migration from deprecated ioutil functions:

  • Replaced ioutil.TempDir with os.MkdirTemp and ioutil.WriteFile with os.WriteFile in the createFiles method of cloudinit.go to create temporary directories and write files. [1] [2]
  • Replaced ioutil.TempFile with os.CreateTemp in the createFile method of ignition.go for creating temporary files. [1] [2]

Summary by CodeRabbit

  • Chores
    • Updated internal dependencies to remove deprecated libraries and improve code maintainability.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 24, 2025

@sebrandon1: The following tests 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/unit 71d88cc link true /test unit
ci/prow/verify-deps 71d88cc link true /test verify-deps
ci/prow/govet 71d88cc link true /test govet

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.

@openshift-bot
Copy link
Copy Markdown
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 23, 2026
@cfergeau
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2026
@openshift-bot
Copy link
Copy Markdown
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci Bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 27, 2026

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: 25f71870-da23-4dac-9507-36219d3072aa

📥 Commits

Reviewing files that changed from the base of the PR and between 63c1b63 and d5bd248.

📒 Files selected for processing (2)
  • pkg/cloud/libvirt/client/cloudinit.go
  • pkg/cloud/libvirt/client/ignition.go

Walkthrough

Two files in the libvirt cloud client are updated to replace deprecated io/ioutil functions with their os package equivalents: os.MkdirTemp, os.WriteFile, and os.CreateTemp.

Changes

Cohort / File(s) Summary
Deprecated io/ioutil Cleanup
pkg/cloud/libvirt/client/cloudinit.go, pkg/cloud/libvirt/client/ignition.go
Replaces deprecated io/ioutil usage with modern os package functions: os.MkdirTemp for temporary directory creation, os.WriteFile for file writes, and os.CreateTemp for temporary file creation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 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 clearly and specifically summarizes the main change: migrating away from deprecated ioutil functions to their os package equivalents.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 non-test source files to migrate from deprecated io/ioutil functions. Repository uses standard Go testing, not Ginkgo. No Ginkgo tests are introduced or modified.
Test Structure And Quality ✅ Passed This PR contains only production code changes (cloudinit.go and ignition.go) migrating from deprecated io/ioutil functions. No Ginkgo test files or test code are included.
Microshift Test Compatibility ✅ Passed This PR only refactors library code to migrate from deprecated io/ioutil functions to modern os package equivalents. No new Ginkgo e2e tests are added, so the check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only modifies non-test utility files (cloudinit.go and ignition.go) migrating from deprecated io/ioutil to os package. No new Ginkgo e2e tests added; check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only internal Go utility files (cloudinit.go, ignition.go) to replace deprecated io/ioutil functions with os package equivalents. No deployment manifests, operator code, or controllers are added or modified.
Ote Binary Stdout Contract ✅ Passed PR replaces deprecated io/ioutil functions with os equivalents; no new stdout writes introduced, OTE Binary Stdout Contract maintained.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies library files in the cloud provider client and does not add any Ginkgo e2e tests.

✏️ 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: 0/10 reviews remaining, refill in 56 minutes and 33 seconds.

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

@sebrandon1 sebrandon1 changed the title Migrate away from deprecated ioutil CNF-23050: 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
Contributor

openshift-ci-robot commented Apr 20, 2026

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

Migration from deprecated ioutil functions:

  • Replaced ioutil.TempDir with os.MkdirTemp and ioutil.WriteFile with os.WriteFile in the createFiles method of cloudinit.go to create temporary directories and write files. [1] [2]
  • Replaced ioutil.TempFile with os.CreateTemp in the createFile method of ignition.go for creating temporary files. [1] [2]

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

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-reference Indicates that this PR references a valid Jira ticket of any type. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants