Skip to content
Open
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 pkg/profiling/config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"io/ioutil"
"os"
"path/filepath"

"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -44,7 +44,7 @@ type config struct {
}

func GetConfig(path string) (*config, error) {
data, err := ioutil.ReadFile(filepath.Join(path, "pprof-config.yaml"))
data, err := os.ReadFile(filepath.Join(path, "pprof-config.yaml"))
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions staging/api/pkg/manifests/bundleloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package manifests

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -180,7 +179,7 @@ func (b *bundleLoader) LoadBundleWalkFunc(path string, f os.FileInfo, err error)
// loadBundle takes the directory that a CSV is in and assumes the rest of the objects in that directory
// are part of the bundle.
func loadBundle(csvName string, dir string) (*Bundle, error) {
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions staging/api/pkg/validation/internal/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package internal
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -225,7 +224,7 @@ func validateImageFile(checks CommunityOperatorChecks, deprecatedAPImsg string)
return checks
}

b, err := ioutil.ReadFile(checks.indexImagePath)
b, err := os.ReadFile(checks.indexImagePath)
if err != nil {
checks.errs = append(checks.errs, fmt.Errorf("unable to read the index image in the path "+
"(%s). Error : %s", checks.indexImagePath, err))
Expand Down
4 changes: 2 additions & 2 deletions staging/api/pkg/validation/internal/crd_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package internal

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

"github.com/operator-framework/api/pkg/validation/errors"
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestValidateCRD(t *testing.T) {
},
}
for _, tt := range table {
b, err := ioutil.ReadFile(tt.filePath)
b, err := os.ReadFile(tt.filePath)
if err != nil {
t.Fatalf("Error reading CRD path %s: %v", tt.filePath, err)
}
Expand Down
4 changes: 2 additions & 2 deletions staging/api/pkg/validation/internal/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package internal

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -121,7 +121,7 @@ func TestValidateCSV(t *testing.T) {
}

for _, c := range cases {
b, err := ioutil.ReadFile(c.csvPath)
b, err := os.ReadFile(c.csvPath)
if err != nil {
t.Fatalf("Error reading CSV path %s: %v", c.csvPath, err)
}
Expand Down
4 changes: 2 additions & 2 deletions staging/api/pkg/validation/internal/object_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package internal

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

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestValidateObject(t *testing.T) {

for _, tt := range table {
u := unstructured.Unstructured{}
o, err := ioutil.ReadFile(tt.path)
o, err := os.ReadFile(tt.path)
if err != nil {
t.Fatalf("reading yaml object file: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions staging/api/pkg/validation/internal/operatorgroup_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package internal

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -33,7 +33,7 @@ func TestValidateOperatorGroup(t *testing.T) {
},
}
for _, c := range cases {
b, err := ioutil.ReadFile(c.operatorGroupPath)
b, err := os.ReadFile(c.operatorGroupPath)
if err != nil {
t.Fatalf("Error reading OperatorGroup path %s: %v", c.operatorGroupPath, err)
}
Expand Down
4 changes: 2 additions & 2 deletions staging/api/pkg/validation/internal/operatorhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package internal
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/mail"
"net/url"
"os"
"path/filepath"
"strings"

Expand Down Expand Up @@ -313,7 +313,7 @@ func extractCategories(path string) (map[string]struct{}, error) {
return nil, fmt.Errorf("finding category file: %w", err)
}

data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if err != nil {
return nil, fmt.Errorf("reading category file: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package buildahregistry

import (
"io/ioutil"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -95,7 +94,7 @@ func NewRegistry(options ...RegistryOption) (registry *Registry, destroy func()
}

// TODO: probably don't want the signature policy to be here
ioutil.WriteFile(path.Join(config.CacheDir, "policy.json"), []byte(`
os.WriteFile(path.Join(config.CacheDir, "policy.json"), []byte(`
{
"default": [
{
Expand Down
3 changes: 1 addition & 2 deletions staging/operator-registry/test/e2e/ctx/provisioner_kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/csv"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -69,7 +68,7 @@ func (kl kindLogAdapter) V(log.Level) log.InfoLogger {
}

func Provision(ctx *TestContext) (func(), error) {
dir, err := ioutil.TempDir("", "kind.")
dir, err := os.MkdirTemp("", "kind.")
if err != nil {
return nil, fmt.Errorf("failed to create temporary directory: %s", err.Error())
}
Expand Down