Skip to content

CNF-23049: Migrate away from deprecated ioutil#454

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

CNF-23049: 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

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

Core refactoring: Replace ioutil usage with io and os equivalents

  • Replaced all instances of ioutil.ReadFile with os.ReadFile for reading files, and ioutil.WriteFile with os.WriteFile for writing files in multiple files, such as dockerregistry.go, config.go, and their respective test files. [1] [2] [3] [4] [5] [6]
  • Replaced all instances of ioutil.ReadAll with io.ReadAll for reading from readers and response bodies, affecting HTTP handlers, test helpers, and utility functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Replaced ioutil.TempDir with os.MkdirTemp for creating temporary directories in tests. [1] [2]
  • Replaced ioutil.Discard with io.Discard for discarding output in logger setup.
  • Removed deprecated ioutil import statements and updated import blocks accordingly across all affected files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

These changes ensure the codebase is compatible with newer Go versions and follows up-to-date language standards.

@flavianmissi
Copy link
Copy Markdown
Member

Thanks for taking the time to do this, @sebrandon1!

/lgtm
/retitle NO-JIRA: Migrate away from deprecated ioutil

@openshift-ci openshift-ci Bot changed the title Migrate away from deprecated ioutil NO-JIRA: Migrate away from deprecated ioutil Nov 27, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 27, 2025
@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

Core refactoring: Replace ioutil usage with io and os equivalents

  • Replaced all instances of ioutil.ReadFile with os.ReadFile for reading files, and ioutil.WriteFile with os.WriteFile for writing files in multiple files, such as dockerregistry.go, config.go, and their respective test files. [1] [2] [3] [4] [5] [6]
  • Replaced all instances of ioutil.ReadAll with io.ReadAll for reading from readers and response bodies, affecting HTTP handlers, test helpers, and utility functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Replaced ioutil.TempDir with os.MkdirTemp for creating temporary directories in tests. [1] [2]
  • Replaced ioutil.Discard with io.Discard for discarding output in logger setup.
  • Removed deprecated ioutil import statements and updated import blocks accordingly across all affected files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

These changes ensure the codebase is compatible with newer Go versions and follows up-to-date language standards.

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.

Comment thread pkg/testframework/registry.go Outdated
@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 Nov 27, 2025
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2025
@flavianmissi
Copy link
Copy Markdown
Member

/lgtm

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

openshift-ci Bot commented Dec 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flavianmissi, 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

@flavianmissi
Copy link
Copy Markdown
Member

this is an internal change.
/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Dec 5, 2025
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 18, 2026

New changes are detected. LGTM label has been removed.

@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

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

Core refactoring: Replace ioutil usage with io and os equivalents

  • Replaced all instances of ioutil.ReadFile with os.ReadFile for reading files, and ioutil.WriteFile with os.WriteFile for writing files in multiple files, such as dockerregistry.go, config.go, and their respective test files. [1] [2] [3] [4] [5] [6]
  • Replaced all instances of ioutil.ReadAll with io.ReadAll for reading from readers and response bodies, affecting HTTP handlers, test helpers, and utility functions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Replaced ioutil.TempDir with os.MkdirTemp for creating temporary directories in tests. [1] [2]
  • Replaced ioutil.Discard with io.Discard for discarding output in logger setup.
  • Removed deprecated ioutil import statements and updated import blocks accordingly across all affected files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

These changes ensure the codebase is compatible with newer Go versions and follows up-to-date language standards.

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@sebrandon1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 11 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 8406ffeb-c4d6-4bbe-a090-135db47aa21c

📥 Commits

Reviewing files that changed from the base of the PR and between 57039cd and 51e4a13.

📒 Files selected for processing (15)
  • pkg/cmd/dockerregistry/dockerregistry.go
  • pkg/dockerregistry/server/blobdescriptorservice_test.go
  • pkg/dockerregistry/server/configuration/configuration.go
  • pkg/dockerregistry/server/signaturedispatcher.go
  • pkg/dockerregistry/server/signaturedispatcher_test.go
  • pkg/dockerregistry/server/util_test.go
  • pkg/kubernetes-common/credentialprovider/config.go
  • pkg/kubernetes-common/credentialprovider/config_test.go
  • pkg/origin-common/clientcmd/clientcmd.go
  • pkg/testframework/registry.go
  • pkg/testutil/logrus.go
  • test/integration/imagelayers/imagelayers_test.go
  • test/integration/pullthrough/pullthrough_test.go
  • test/integration/v2/v2_docker_registry_test.go
  • tools/import-verifier/import-verifier.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 0/10 reviews remaining, refill in 2 minutes and 11 seconds.

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 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.

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. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. px-approved Signifies that Product Support has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants