Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove refs to deprecated io/ioutil #2541

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/cni-metrics-helper/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package metrics

import (
"context"
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -40,7 +40,7 @@ func newTestMetricsTarget(metricFile string, interestingMetrics map[string]metri
}

func (target *testMetricsTarget) grabMetricsFromTarget(ctx context.Context, targetName string) ([]byte, error) {
testMetrics, _ := ioutil.ReadFile(target.metricFile)
testMetrics, _ := os.ReadFile(target.metricFile)

return testMetrics, nil
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/ipamd/datastore/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package datastore

import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
)
Expand Down Expand Up @@ -78,7 +77,7 @@ func NewJSONFile(path string) *JSONFile {

// Checkpoint implements the Checkpointer interface
func (c *JSONFile) Checkpoint(data interface{}) error {
f, err := ioutil.TempFile(filepath.Dir(c.path), filepath.Base(c.path)+".tmp*")
f, err := os.CreateTemp(filepath.Dir(c.path), filepath.Base(c.path)+".tmp*")
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions test/framework/resources/aws/utils/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package utils

import (
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -73,7 +73,7 @@ type AWSAuthMapRole struct {
// Create self managed node group stack
func CreateAndWaitTillSelfManagedNGReady(f *framework.Framework, properties NodeGroupProperties) error {
templatePath := utils.GetProjectRoot() + CreateNodeGroupCFNTemplate
templateBytes, err := ioutil.ReadFile(templatePath)
templateBytes, err := os.ReadFile(templatePath)
if err != nil {
return fmt.Errorf("failed to read from %s, %v", templatePath, err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/ipamd/ipamd_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package ipamd

import (
"fmt"
"io/ioutil"
"net/url"
"os"
"strings"
"time"

Expand Down Expand Up @@ -79,7 +79,7 @@ var _ = Describe("test aws-node pod event", func() {
masterPolicyName = "masters." + *aws.String(f.Options.ClusterName)
nodePolicyName = "nodes." + *aws.String(f.Options.ClusterName)
dummyPolicyDocumentPath := utils.GetProjectRoot() + DummyPolicyDocument
dummyRolePolicyBytes, err := ioutil.ReadFile(dummyPolicyDocumentPath)
dummyRolePolicyBytes, err := os.ReadFile(dummyPolicyDocumentPath)
Expect(err).ToNot(HaveOccurred())

dummyRolePolicyData := string(dummyRolePolicyBytes)
Expand Down