Skip to content

Commit ee888eb

Browse files
authored
Merge pull request #114 from e0ne/cleanup
Cleanup pkg/utils/utils.go
2 parents b35b9e2 + 95d75b6 commit ee888eb

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

pkg/state/state_nv_peer.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package state
22

33
import (
4+
"os"
5+
46
"github.com/pkg/errors"
57
appsv1 "k8s.io/api/apps/v1"
68
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -141,9 +143,9 @@ func (s *stateNVPeer) getManifestObjects(
141143
CPUArch: attrs[0].Attributes[nodeinfo.AttrTypeCPUArch],
142144
OSName: attrs[0].Attributes[nodeinfo.AttrTypeOSName],
143145
OSVer: attrs[0].Attributes[nodeinfo.AttrTypeOSVer],
144-
HTTPProxy: utils.GetEnv(consts.HTTPProxy),
145-
HTTPSProxy: utils.GetEnv(consts.HTTPSProxy),
146-
NoProxy: utils.GetEnv(consts.NoProxy),
146+
HTTPProxy: os.Getenv(consts.HTTPProxy),
147+
HTTPSProxy: os.Getenv(consts.HTTPSProxy),
148+
NoProxy: os.Getenv(consts.NoProxy),
147149
},
148150
}
149151
// render objects

pkg/state/state_ofed.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package state
1818

1919
import (
20+
"os"
21+
2022
"github.com/pkg/errors"
2123
appsv1 "k8s.io/api/apps/v1"
2224
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -154,9 +156,9 @@ func (s *stateOFED) getManifestObjects(
154156
CPUArch: attrs[0].Attributes[nodeinfo.AttrTypeCPUArch],
155157
OSName: attrs[0].Attributes[nodeinfo.AttrTypeOSName],
156158
OSVer: attrs[0].Attributes[nodeinfo.AttrTypeOSVer],
157-
HTTPProxy: utils.GetEnv(consts.HTTPProxy),
158-
HTTPSProxy: utils.GetEnv(consts.HTTPSProxy),
159-
NoProxy: utils.GetEnv(consts.NoProxy),
159+
HTTPProxy: os.Getenv(consts.HTTPProxy),
160+
HTTPSProxy: os.Getenv(consts.HTTPSProxy),
161+
NoProxy: os.Getenv(consts.NoProxy),
160162
},
161163
}
162164
// render objects

pkg/utils/utils.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"strings"
2323

2424
"github.com/pkg/errors"
25-
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2625
)
2726

2827
// GetFilesWithSuffix returns all files under a given base directory that have a specific suffix
@@ -54,12 +53,3 @@ func GetFilesWithSuffix(baseDir string, suffixes ...string) ([]string, error) {
5453
}
5554
return files, nil
5655
}
57-
58-
func IsCRD(obj *unstructured.Unstructured) bool {
59-
return obj.GetKind() == "CustomResourceDefinition"
60-
}
61-
62-
// Getenv retrieves the value of the environment variable
63-
func GetEnv(name string) string {
64-
return os.Getenv(name)
65-
}

0 commit comments

Comments
 (0)