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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
version: v1.45.2
args:
-v
--config=.golangci.yml
Expand Down
55 changes: 1 addition & 54 deletions cmd/flags/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,71 +3,18 @@ package flags
import (
"testing"

"github.com/loft-sh/devspace/pkg/devspace/config/localcache"
"github.com/loft-sh/devspace/pkg/util/log"

"gotest.tools/assert"
)

type useLastContextTestCase struct {
name string

globalFlags GlobalFlags
generatedConfig *localcache.Config

expectedErr string
}

func TestUseLastContext(t *testing.T) {
testCases := []useLastContextTestCase{
{
name: "Switch context to existent",
globalFlags: GlobalFlags{
SwitchContext: true,
},
generatedConfig: &localcache.Config{
ActiveProfile: "someProfile",
Profiles: map[string]*localcache.CacheConfig{
"someProfile": {
LastContext: &localcache.LastContextConfig{
Context: "myKubeContext",
Namespace: "myNamespace",
},
},
},
},
},
{
name: "Nothing happens",
globalFlags: GlobalFlags{},
},
}

for _, testCase := range testCases {
testUseLastContext(t, testCase)
}
}

func testUseLastContext(t *testing.T, testCase useLastContextTestCase) {
err := testCase.globalFlags.UseLastContext(testCase.generatedConfig, &log.DiscardLogger{})

if testCase.expectedErr == "" {
assert.NilError(t, err, "Unexpected error in testCase %s.", testCase.name)
} else {
assert.Error(t, err, testCase.expectedErr, "Wrong or no error in testCase %s.", testCase.name)
}
}

func TestToConfigOptions(t *testing.T) {
configOptions := (&GlobalFlags{
Profiles: []string{"myProfile2", "myProfile"},
KubeContext: "myKubeContext",
Vars: []string{"var1", "var2"},
}).ToConfigOptions(log.Discard)
}).ToConfigOptions()

assert.Equal(t, configOptions.Profiles[0], "myProfile2", "ConfigOptions has wrong profiles")
assert.Equal(t, configOptions.Profiles[1], "myProfile", "ConfigOptions has wrong profiles")
assert.Equal(t, configOptions.KubeContext, "myKubeContext", "ConfigOptions has wrong kube context")
assert.Equal(t, len(configOptions.Vars), 2, "ConfigOptions has wrong vars")
assert.Equal(t, configOptions.Vars[0], "var1", "ConfigOptions has wrong vars")
assert.Equal(t, configOptions.Vars[1], "var2", "ConfigOptions has wrong vars")
Expand Down
17 changes: 1 addition & 16 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func getProjectName() (string, string, error) {
gitRemote, err := command.Output(context.TODO(), "", "git", "config", "--get", "remote.origin.url")
if err == nil {
sep := "/"
projectParts := strings.Split(string(regexp.MustCompile("^.*?://[^/]+?/([^.]+)(\\.git)?").ReplaceAll(gitRemote, []byte("$1"))), sep)
projectParts := strings.Split(string(regexp.MustCompile(`^.*?://[^/]+?/([^.]+)(\.git)?`).ReplaceAll(gitRemote, []byte("$1"))), sep)
partsLen := len(projectParts)
if partsLen > 1 {
projectNamespace = strings.Join(projectParts[0:partsLen-1], sep)
Expand Down Expand Up @@ -677,21 +677,6 @@ func (cmd *InitCmd) addDevConfig(config *latest.Config, imageName, image string,
Command: "./" + startScriptName,
}

// Determine language
language, err := languageHandler.GetLanguage()
if err != nil {
return err
}

if language == "java" {
stat, err := os.Stat("build.gradle")
if err == nil && !stat.IsDir() {
language += "-gradle"
} else {
language += "-maven"
}
}

devImage, err := languageHandler.GetDevImage()
if err != nil {
return err
Expand Down
13 changes: 7 additions & 6 deletions cmd/run_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package cmd
import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"strings"

"github.com/loft-sh/devspace/cmd/flags"
"github.com/loft-sh/devspace/pkg/devspace/build"
"github.com/loft-sh/devspace/pkg/devspace/config"
Expand Down Expand Up @@ -33,11 +38,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"io"
"io/ioutil"
"k8s.io/client-go/kubernetes/fake"
"os"
"strings"
)

// RunPipelineCmd holds the command flags
Expand Down Expand Up @@ -71,8 +72,8 @@ type RunPipelineCmd struct {
Ctx context.Context
RenderWriter io.Writer

configLoader loader.ConfigLoader
log log.Logger
// configLoader loader.ConfigLoader
log log.Logger
}

func (cmd *RunPipelineCmd) AddFlags(command *cobra.Command) {
Expand Down
11 changes: 6 additions & 5 deletions e2e/tests/dependencies/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package dependencies

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

"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
dependencyutil "github.com/loft-sh/devspace/pkg/devspace/dependency/util"
"github.com/loft-sh/devspace/pkg/devspace/kubectl/selector"
"io/ioutil"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/wait"
"os"
"path/filepath"
"time"

"github.com/loft-sh/devspace/cmd"
"github.com/loft-sh/devspace/cmd/flags"
Expand Down Expand Up @@ -135,7 +136,7 @@ var _ = DevSpaceDescribe("dependencies", func() {
framework.ExpectNoError(err)

// make sure the dependencies are correctly deployed
deploy, err = kubeClient.RawClient().AppsV1().Deployments(ns).Get(context.TODO(), "my-deployment", metav1.GetOptions{})
_, err = kubeClient.RawClient().AppsV1().Deployments(ns).Get(context.TODO(), "my-deployment", metav1.GetOptions{})
framework.ExpectError(err)

// check if replica set exists & pod got replaced correctly
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/blang/semver v3.5.1+incompatible
github.com/bmatcuk/doublestar v1.1.1
github.com/compose-spec/compose-go v1.0.1
github.com/creack/pty v1.1.15
github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v20.10.5+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/go-metrics v0.0.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/evanphx/json-patch/v5 v5.1.0
github.com/ghodss/yaml v1.0.0
github.com/gliderlabs/ssh v0.3.3
github.com/google/uuid v1.1.2
github.com/gorilla/websocket v1.4.2
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
github.com/jessevdk/go-flags v1.4.0
github.com/joho/godotenv v1.3.0
Expand Down
18 changes: 0 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN
github.com/aws/aws-sdk-go v1.25.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand All @@ -211,7 +210,6 @@ github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2
github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
Expand All @@ -238,10 +236,6 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/compose-spec/compose-go v1.0.1 h1:yXTL3UEefSeGIFCYam7D4acrC1Z4sBlTLtjHc/MDQ2s=
github.com/compose-spec/compose-go v1.0.1/go.mod h1:JJXU4DzTtNGWocymZcRWMpRRWl2NbmTZEA977BQqr5w=
github.com/compose-spec/godotenv v1.0.0 h1:TV24JYhh5GCC1G14npQVhCtxeoiwd0NcT0VdwcCQyXU=
github.com/compose-spec/godotenv v1.0.0/go.mod h1:zF/3BOa18Z24tts5qnO/E9YURQanJTBUf7nlcCTNsyc=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 h1:9atoWyI9RtXFwf7UDbme/6M8Ud0rFrx+Q3ZWgSnsxtw=
Expand Down Expand Up @@ -309,8 +303,6 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e h1:n81KvOMrLZa+VWHwST7dun9f0G98X3zREHS1ztYzZKU=
github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e/go.mod h1:xpWTC2KnJMiDLkoawhsPQcXjvwATEBcbq0xevG2YR9M=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
Expand Down Expand Up @@ -524,7 +516,6 @@ github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunE
github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4=
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ=
github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk=
github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
Expand Down Expand Up @@ -601,7 +592,6 @@ github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhj
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
Expand Down Expand Up @@ -783,8 +773,6 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
Expand All @@ -809,7 +797,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
github.com/moby/buildkit v0.8.2 h1:kvb0cLWss4mOhCxcXSTENzzA+t1JR1eIyXFhDrI+73g=
Expand Down Expand Up @@ -1138,13 +1125,9 @@ github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfD
github.com/xanzy/go-gitlab v0.32.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70=
github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
Expand Down Expand Up @@ -1219,7 +1202,6 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package proxy_commands
package proxycommands

import (
"encoding/base64"
"fmt"
"github.com/loft-sh/devspace/helper/util/stderrlog"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"io/ioutil"
"os"
"strings"

"github.com/loft-sh/devspace/helper/util/stderrlog"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

var (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package proxy_commands
package proxycommands

import (
"github.com/spf13/cobra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package proxy_commands
package proxycommands

import (
"encoding/json"
"io/ioutil"
"os"

"github.com/loft-sh/devspace/helper/types"
"github.com/loft-sh/devspace/pkg/util/terminal"
"github.com/moby/term"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/crypto/ssh"
"io/ioutil"
"os"
)

// RunCmd holds the ssh cmd flags
Expand Down
5 changes: 3 additions & 2 deletions helper/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cmd

import (
"fmt"
"github.com/loft-sh/devspace/helper/cmd/proxy_commands"
"os"

"github.com/loft-sh/devspace/helper/cmd/proxycommands"

"github.com/loft-sh/devspace/helper/cmd/sync"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -40,6 +41,6 @@ func BuildRoot() *cobra.Command {
rootCmd.AddCommand(NewTunnelCmd())
rootCmd.AddCommand(NewSSHCmd())
rootCmd.AddCommand(sync.NewSyncCmd())
rootCmd.AddCommand(proxy_commands.NewProxyCommands())
rootCmd.AddCommand(proxycommands.NewProxyCommands())
return rootCmd
}
8 changes: 3 additions & 5 deletions pkg/devspace/build/builder/buildkit/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
command2 "github.com/loft-sh/devspace/pkg/util/command"
"io"
"io/ioutil"
"math/rand"
Expand All @@ -16,6 +14,9 @@ import (
"strings"
"time"

devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
command2 "github.com/loft-sh/devspace/pkg/util/command"

cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/docker/api/types"
"github.com/loft-sh/devspace/pkg/devspace/build/builder/docker"
Expand Down Expand Up @@ -132,8 +133,6 @@ func (b *Builder) BuildImage(ctx *devspacecontext.Context, contextPath, dockerfi
}

func buildWithCLI(ctx context.Context, dir string, context io.Reader, writer io.Writer, kubeClient kubectl.Client, builder string, imageConf *latest.BuildKitConfig, options types.ImageBuildOptions, useMinikubeDocker, skipPush bool, log logpkg.Logger) error {
environ := os.Environ()

command := []string{"docker", "buildx"}
if len(imageConf.Command) > 0 {
command = imageConf.Command
Expand Down Expand Up @@ -177,7 +176,6 @@ func buildWithCLI(ctx context.Context, dir string, context io.Reader, writer io.
}
defer os.Remove(tempFile)

environ = append(environ, "KUBECONFIG="+tempFile)
args = append(args, "--builder", builder)

// TODO: find a better solution than this
Expand Down
Loading