Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.19

- name: Build devspacehelper
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
go-version: 1.19
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v1
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v1
Expand Down
15 changes: 8 additions & 7 deletions assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -619,7 +618,7 @@ func (cmd *InitCmd) initDockerCompose(f factory.Factory, composePath string) err
}

func annotateConfig(configPath string) error {
annotatedConfig, err := ioutil.ReadFile(configPath)
annotatedConfig, err := os.ReadFile(configPath)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -677,7 +676,7 @@ func annotateConfig(configPath string) error {
# size: 5Gi
`)...)

err = ioutil.WriteFile(configPath, annotatedConfig, os.ModePerm)
err = os.WriteFile(configPath, annotatedConfig, os.ModePerm)
if err != nil {
return err
}
Expand Down Expand Up @@ -853,7 +852,7 @@ func appendToIgnoreFile(ignoreFile, content string) error {
if os.IsNotExist(err) {
_ = fsutil.WriteToFile([]byte(content), ignoreFile)
} else {
fileContent, err := ioutil.ReadFile(ignoreFile)
fileContent, err := os.ReadFile(ignoreFile)
if err != nil {
return errors.Errorf("Error reading file %s: %v", ignoreFile, err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"flag"
"fmt"
"github.com/loft-sh/devspace/pkg/devspace/kill"
"io/ioutil"
"io"
"os"
"strings"
"sync"
Expand Down Expand Up @@ -303,12 +303,12 @@ func disableKlog() {
flagSet := &flag.FlagSet{}
klog.InitFlags(flagSet)
_ = flagSet.Set("logtostderr", "false")
klog.SetOutput(ioutil.Discard)
klog.SetOutput(io.Discard)

flagSet = &flag.FlagSet{}
klogv2.InitFlags(flagSet)
_ = flagSet.Set("logtostderr", "false")
klogv2.SetOutput(ioutil.Discard)
klogv2.SetOutput(io.Discard)
}

func parseConfig(f factory.Factory) (*RawConfig, error) {
Expand Down
3 changes: 1 addition & 2 deletions cmd/run_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"io"
"io/ioutil"
"os"
)

Expand Down Expand Up @@ -274,7 +273,7 @@ func initialize(ctx context.Context, f factory.Factory, options *CommandOptions,
log.StartFileLogging()

// create a temporary folder for us to use
tempFolder, err := ioutil.TempDir("", "devspace-")
tempFolder, err := os.MkdirTemp("", "devspace-")
if err != nil {
return nil, errors.Wrap(err, "create temporary folder")
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/loft-sh/devspace/pkg/devspace/config/localcache"
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
"github.com/loft-sh/devspace/pkg/devspace/kubectl"
"io/ioutil"
"io"
"net/http"
"time"

Expand Down Expand Up @@ -108,7 +108,7 @@ func (cmd *UICmd) RunUI(f factory.Factory) error {
}

defer response.Body.Close()
contents, err := ioutil.ReadAll(response.Body)
contents, err := io.ReadAll(response.Body)
if err != nil {
checkPort++
continue
Expand Down
5 changes: 2 additions & 3 deletions docs/hack/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
Expand Down Expand Up @@ -78,14 +77,14 @@ func main() {
return nil
}

content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
if err != nil {
return err
}

newContents := fixSynopsisRegexp.ReplaceAllString(string(content), "$2$3$7$8```\n$4\n```\n\n\n## Flags$10\n## Global & Inherited Flags$13")

err = ioutil.WriteFile(path, []byte(newContents), 0)
err = os.WriteFile(path, []byte(newContents), 0)
if err != nil {
return err
}
Expand Down
11 changes: 5 additions & 6 deletions docs/hack/functions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -69,7 +68,7 @@ func main() {
anchorName := function.Name
functionContent := importContent + "\n" + fmt.Sprintf(util.TemplateFunctionRef, flagContent != "", "", "### ", function.Name, function.Args, argEnum, function.Return, !function.IsGlobal, anchorName, function.Description, flagContent)

err = ioutil.WriteFile(functionFile, []byte(functionContent), os.ModePerm)
err = os.WriteFile(functionFile, []byte(functionContent), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -163,17 +162,17 @@ func main() {

util.ProcessGroups(groups)

err := ioutil.WriteFile(functionRefFile, []byte(functionRefContent), os.ModePerm)
err := os.WriteFile(functionRefFile, []byte(functionRefContent), os.ModePerm)
if err != nil {
panic(err)
}

err = ioutil.WriteFile(globalFunctionRefFile, []byte(globalFunctionRefContent), os.ModePerm)
err = os.WriteFile(globalFunctionRefFile, []byte(globalFunctionRefContent), os.ModePerm)
if err != nil {
panic(err)
}

err = ioutil.WriteFile(pipelineFunctionRefFile, []byte(pipelineFunctionRefContent), os.ModePerm)
err = os.WriteFile(pipelineFunctionRefFile, []byte(pipelineFunctionRefContent), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -210,7 +209,7 @@ func getFlagReference(functionName, functionFile string, flagRef reflect.Type, p
panic(err)
}

err = ioutil.WriteFile(flagFile, []byte(flagContent), os.ModePerm)
err = os.WriteFile(flagFile, []byte(flagContent), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down
3 changes: 1 addition & 2 deletions docs/hack/util/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package util

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -42,7 +41,7 @@ func ProcessGroups(groups map[string]*Group) {
panic(err)
}

err = ioutil.WriteFile(group.File, []byte(groupFileContent), os.ModePerm)
err = os.WriteFile(group.File, []byte(groupFileContent), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down
5 changes: 2 additions & 3 deletions docs/hack/util/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package util

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
Expand Down Expand Up @@ -206,7 +205,7 @@ func createSections(basePath, prefix string, schema *jsonschema.Schema, definiti
panic(err)
}

err = ioutil.WriteFile(fieldFile, []byte(fieldContent), os.ModePerm)
err = os.WriteFile(fieldFile, []byte(fieldContent), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -258,7 +257,7 @@ func createSections(basePath, prefix string, schema *jsonschema.Schema, definiti

content = fmt.Sprintf("%s%s", importContent, content)

err := ioutil.WriteFile(pageFile, []byte(content), os.ModePerm)
err := os.WriteFile(pageFile, []byte(content), os.ModePerm)
if err != nil {
panic(err)
}
Expand Down
9 changes: 4 additions & 5 deletions e2e/framework/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package framework
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
Expand Down Expand Up @@ -156,20 +155,20 @@ func ExpectRemoteContainerFileContents(labelSelector, container string, namespac
}

func ExpectLocalFileContentsImmediately(filePath string, contents string) {
out, err := ioutil.ReadFile(filePath)
out, err := os.ReadFile(filePath)
ExpectNoError(err)
gomega.ExpectWithOffset(1, string(out)).To(gomega.Equal(contents))
}

func ExpectLocalFileContainSubstringImmediately(filePath string, contents string) {
out, err := ioutil.ReadFile(filePath)
out, err := os.ReadFile(filePath)
ExpectNoError(err)
gomega.ExpectWithOffset(1, string(out)).To(gomega.ContainSubstring(contents))
}

func ExpectLocalFileContents(filePath string, contents string) {
err := wait.PollImmediate(time.Second, time.Minute*2, func() (done bool, err error) {
out, err := ioutil.ReadFile(filePath)
out, err := os.ReadFile(filePath)
if err != nil {
if !os.IsNotExist(err) {
return false, err
Expand All @@ -184,7 +183,7 @@ func ExpectLocalFileContents(filePath string, contents string) {
}

func ExpectLocalFileContentsWithoutSpaces(filePath string, contents string) {
out, err := ioutil.ReadFile(filePath)
out, err := os.ReadFile(filePath)
ExpectNoError(err)
gomega.ExpectWithOffset(1, strings.TrimSpace(string(out))).To(gomega.Equal(contents))
}
Expand Down
5 changes: 2 additions & 3 deletions e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package framework
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -100,7 +99,7 @@ func CleanupTempDir(initialDir, tempDir string) {
}

func CopyToTempDir(relativePath string) (string, error) {
dir, err := ioutil.TempDir("", "temp-*")
dir, err := os.MkdirTemp("", "temp-*")
if err != nil {
return "", err
}
Expand All @@ -126,7 +125,7 @@ func CopyToTempDir(relativePath string) (string, error) {
}

func ChangeToTempDir() (string, error) {
dir, err := ioutil.TempDir("", "")
dir, err := os.MkdirTemp("", "")
if err != nil {
return "", err
}
Expand Down
3 changes: 1 addition & 2 deletions e2e/tests/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package config
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -110,7 +109,7 @@ var _ = DevSpaceDescribe("config", func() {
framework.ExpectNoError(err)

ic, _ := config.GetImageCache("app-test")
out, err := ioutil.ReadFile(filepath.Join(tempDir, "out0.txt"))
out, err := os.ReadFile(filepath.Join(tempDir, "out0.txt"))
framework.ExpectNoError(err)
gomega.Expect(string(out)).To(gomega.MatchRegexp("my-docker-username/helloworld2:" + ic.Tag))
})
Expand Down
3 changes: 1 addition & 2 deletions e2e/tests/dependencies/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dependencies

import (
"context"
"io/ioutil"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -225,7 +224,7 @@ dep2dep2wait
framework.ExpectRemoteFileContents("alpine", ns, "/app/test.txt", "dependency123")

// now check if sync is still working
err = ioutil.WriteFile(filepath.Join(dependencyPath, "test123.txt"), []byte("test123"), 0777)
err = os.WriteFile(filepath.Join(dependencyPath, "test123.txt"), []byte("test123"), 0777)
framework.ExpectNoError(err)

// now check if file gets synced
Expand Down
Loading