Skip to content

Commit cde3a8d

Browse files
committedJun 21, 2022
fix: show error if yaml reading failed
1 parent d1249b3 commit cde3a8d

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed
 

‎.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
run:
22
timeout: 10m
3+
skip-dirs:
4+
- hack/
5+
- docs/
36

47
linters:
58
disable-all: true

‎helper/util/conn.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package util
22

33
import (
44
"context"
5+
"google.golang.org/grpc/credentials/insecure"
56
"io"
67
"net"
78

@@ -13,7 +14,7 @@ func NewClientConnection(reader io.Reader, writer io.Writer) (*grpc.ClientConn,
1314
pipe := NewStdStreamJoint(reader, writer, false)
1415

1516
// Set up a connection to the server.
16-
return grpc.Dial("", grpc.WithInsecure(), grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
17+
return grpc.Dial("", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
1718
return pipe, nil
1819
}))
1920
}

‎pkg/devspace/deploy/deployer/helm/deploy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package helm
22

33
import (
4+
"fmt"
45
"github.com/loft-sh/devspace/pkg/devspace/config/versions"
56
"io"
67
"os"
@@ -218,11 +219,10 @@ func (d *DeployConfig) getDeploymentValues(ctx devspacecontext.Context) (bool, m
218219
if d.DeploymentConfig.Helm.ValuesFiles != nil {
219220
for _, overridePath := range d.DeploymentConfig.Helm.ValuesFiles {
220221
overwriteValuesPath := ctx.ResolvePath(overridePath)
221-
222222
overwriteValuesFromPath := map[string]interface{}{}
223223
err = yamlutil.ReadYamlFromFile(overwriteValuesPath, overwriteValuesFromPath)
224224
if err != nil {
225-
ctx.Log().Warnf("Error reading from chart dev overwrite values %s: %v", overwriteValuesPath, err)
225+
return false, nil, fmt.Errorf("error reading from chart dev overwrite values %s: %v", overwriteValuesPath, err)
226226
}
227227

228228
// Replace image names

‎pkg/devspace/deploy/deployer/helm/deploy_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ func TestDeploy(t *testing.T) {
6060
// },
6161
// },
6262
{
63-
name: "Deploy one deployment",
64-
deployment: "deploy2",
65-
chart: ".",
66-
valuesFiles: []string{"."},
63+
name: "Deploy one deployment",
64+
deployment: "deploy2",
65+
chart: ".",
6766
values: map[string]interface{}{
6867
"val": "fromVal",
6968
},
@@ -72,7 +71,7 @@ func TestDeploy(t *testing.T) {
7271
Deployments: []remotecache.DeploymentCache{
7372
{
7473
Name: "deploy2",
75-
DeploymentConfigHash: "d4caa406182729245229e8cc01179a72f3cfe3f2fcb4685255b821d711235be4",
74+
DeploymentConfigHash: "038007a9e5018dcf8ffbabad39c1fdc08251e583d7b19e74b765b815d5302444",
7675
Helm: &remotecache.HelmCache{
7776
Release: "deploy2",
7877
ReleaseNamespace: "testNamespace",

0 commit comments

Comments
 (0)