chore: require go >=1.18, bump deps and get rid of replace directives (#1552)
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package compose
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -179,11 +179,11 @@ func normalizeNetworkNames(netName string) (string, error) {
|
||||
func ReadFile(fileName string) ([]byte, error) {
|
||||
if fileName == "-" {
|
||||
if StdinData == nil {
|
||||
data, err := ioutil.ReadAll(os.Stdin)
|
||||
data, err := io.ReadAll(os.Stdin)
|
||||
StdinData = data
|
||||
return data, err
|
||||
}
|
||||
return StdinData, nil
|
||||
}
|
||||
return ioutil.ReadFile(fileName)
|
||||
return os.ReadFile(fileName)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package testutils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
@@ -15,7 +14,7 @@ func NewCommand(cmd string) *exec.Cmd {
|
||||
|
||||
// CreateLocalDirectory TODO: comment
|
||||
func CreateLocalDirectory(t *testing.T) string {
|
||||
dir, err := ioutil.TempDir(os.TempDir(), "kompose-test-")
|
||||
dir, err := os.MkdirTemp(os.TempDir(), "kompose-test-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -79,7 +78,7 @@ func generateHelm(dirName string) error {
|
||||
|
||||
/* Create the readme file */
|
||||
readme := "This chart was created by Kompose\n"
|
||||
err = ioutil.WriteFile(dirName+string(os.PathSeparator)+"README.md", []byte(readme), 0644)
|
||||
err = os.WriteFile(dirName+string(os.PathSeparator)+"README.md", []byte(readme), 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -102,7 +101,7 @@ home:
|
||||
var chartData bytes.Buffer
|
||||
_ = t.Execute(&chartData, details)
|
||||
|
||||
err = ioutil.WriteFile(dirName+string(os.PathSeparator)+"Chart.yaml", chartData.Bytes(), 0644)
|
||||
err = os.WriteFile(dirName+string(os.PathSeparator)+"Chart.yaml", chartData.Bytes(), 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -839,7 +838,7 @@ func GetEnvsFromFile(file string, opt kobject.ConvertOptions) (map[string]string
|
||||
|
||||
// GetContentFromFile gets the content from the file..
|
||||
func GetContentFromFile(file string) (string, error) {
|
||||
fileBytes, err := ioutil.ReadFile(file)
|
||||
fileBytes, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "Unable to read file")
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package kubernetes
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -267,7 +266,7 @@ func (k *Kubernetes) IntiConfigMapFromFileOrDir(name, cmName, filePath string, s
|
||||
|
||||
switch mode := fi.Mode(); {
|
||||
case mode.IsDir():
|
||||
files, err := ioutil.ReadDir(filePath)
|
||||
files, err := os.ReadDir(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ package transformer
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
@@ -290,7 +289,7 @@ func Print(name, path string, trailing string, data []byte, toStdout, generateJS
|
||||
} else {
|
||||
// Write content separately to each file
|
||||
file = filepath.Join(path, file)
|
||||
if err := ioutil.WriteFile(file, data, 0644); err != nil {
|
||||
if err := os.WriteFile(file, data, 0644); err != nil {
|
||||
return "", errors.Wrap(err, "Failed to write %s: "+trailing)
|
||||
}
|
||||
log.Printf("%s file %q created", formatProviderName(provider), file)
|
||||
|
||||
@@ -18,7 +18,6 @@ package docker
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -43,7 +42,7 @@ func (c *Build) BuildImage(source string, image string, dockerfile string, build
|
||||
log.Infof("Building image '%s' from directory '%s'", image, path.Base(source))
|
||||
|
||||
// Create a temporary file for tarball image packaging
|
||||
tmpFile, err := ioutil.TempFile(os.TempDir(), "kompose-image-build-")
|
||||
tmpFile, err := os.CreateTemp(os.TempDir(), "kompose-image-build-")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user