Migrate away from deprecated ioutil#1160
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sebrandon1: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 thanks so much for this! Unfortunately, the changes done under the staging directory need to happen upstream first and then get downstreamed.
that bring your proposed changes to the upstream components. Could you please revert the changes under staging and just check in the pkg/profiling/config changes? |
ioutilhas been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutilTracking issue: redhat-best-practices-for-k8s/telco-bot#52
Migration from
ioutiltoosfor file and directory operations:Replaced
ioutil.ReadFilewithos.ReadFileandioutil.ReadDirwithos.ReadDirin core configuration and bundle loading logic, such as inpkg/profiling/config/config.goandstaging/api/pkg/manifests/bundleloader.go. [1] [2] [3] [4]Updated validation and testing files to use
os.ReadFileinstead ofioutil.ReadFile, including files likestaging/api/pkg/validation/internal/community.go,crd_test.go,csv_test.go,object_test.go, andoperatorgroup_test.go. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Updated additional internal and registry logic to use
os.ReadFile,os.WriteFile, andos.MkdirTempin place of theirioutilcounterparts, such as inoperatorhub.go,buildahregistry/_options.go, andprovisioner_kind.go. [1] [2] [3] [4] [5] [6]