Skip to content

Commit 832f264

Browse files
atantawiopenshift-merge-robot
authored andcommitted
replace deprecated ioutil with os
1 parent ce87762 commit 832f264

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

pkg/quotaplugins/quota-forest/quota-manager/quota/consumerinfo.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Multi-Cluster App Dispatcher Authors.
2+
Copyright 2022, 2023 The Multi-Cluster App Dispatcher Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ package quota
1919
import (
2020
"encoding/json"
2121
"fmt"
22-
"io/ioutil"
22+
"os"
2323

2424
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota/core"
2525
"github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota/utils"
@@ -49,7 +49,7 @@ func NewConsumerInfo(consumerStruct utils.JConsumer) (*ConsumerInfo, error) {
4949

5050
// NewConsumerInfoFromFile : create a new ConsumerInfo from Json file
5151
func NewConsumerInfoFromFile(consumerFileName string) (*ConsumerInfo, error) {
52-
byteValue, err := ioutil.ReadFile(consumerFileName)
52+
byteValue, err := os.ReadFile(consumerFileName)
5353
if err != nil {
5454
return nil, err
5555
}

pkg/quotaplugins/quota-forest/quota-manager/quota/core/forestconsumer.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
Copyright 2022 The Multi-Cluster App Dispatcher Authors.
2+
Copyright 2022, 2023 The Multi-Cluster App Dispatcher Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,7 +19,7 @@ import (
1919
"bytes"
2020
"encoding/json"
2121
"fmt"
22-
"io/ioutil"
22+
"os"
2323

2424
utils "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/quotaplugins/quota-forest/quota-manager/quota/utils"
2525
)
@@ -42,7 +42,7 @@ func NewForestConsumer(id string, consumers map[string]*Consumer) *ForestConsume
4242

4343
// NewForestConsumerFromFile : create a forest consumer from JSON file
4444
func NewForestConsumerFromFile(consumerFileName string, resourceNames map[string][]string) (*ForestConsumer, error) {
45-
byteValue, err := ioutil.ReadFile(consumerFileName)
45+
byteValue, err := os.ReadFile(consumerFileName)
4646
if err != nil {
4747
return nil, err
4848
}
@@ -108,7 +108,7 @@ func (fc *ForestConsumer) GetTreeConsumer(treeName string) *Consumer {
108108
return fc.consumers[treeName]
109109
}
110110

111-
//IsAllocated : is consumer allocated on all trees in the forest
111+
// IsAllocated : is consumer allocated on all trees in the forest
112112
func (fc *ForestConsumer) IsAllocated() bool {
113113
for _, consumer := range fc.consumers {
114114
if !consumer.IsAllocated() {

pkg/quotaplugins/quota-forest/quota-manager/quota/core/treecache.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
Copyright 2022 The Multi-Cluster App Dispatcher Authors.
2+
Copyright 2022, 2023 The Multi-Cluster App Dispatcher Authors.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,7 +19,7 @@ import (
1919
"bytes"
2020
"encoding/json"
2121
"fmt"
22-
"io/ioutil"
22+
"os"
2323
"reflect"
2424
"sort"
2525
"strconv"
@@ -243,7 +243,7 @@ func (tc *TreeCache) FromFile(treeFileName string) error {
243243
/*
244244
* parse JSON file
245245
*/
246-
byteValue, err := ioutil.ReadFile(treeFileName)
246+
byteValue, err := os.ReadFile(treeFileName)
247247
if err != nil {
248248
return fmt.Errorf("error reading file: %s", err.Error())
249249
}

0 commit comments

Comments
 (0)