From a1c43d13390d56e5b5922816d9f19cc7099146a7 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 6 Sep 2018 14:01:27 +0200 Subject: [PATCH 1/2] Resolve #143 --- cmd/up.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/up.go b/cmd/up.go index fab961b441..959a1b62b8 100644 --- a/cmd/up.go +++ b/cmd/up.go @@ -62,7 +62,7 @@ var UpFlagsDefault = &UpCmdFlags{ initRegistry: true, build: true, sync: true, - deploy: true, + deploy: false, portforwarding: true, noSleep: false, } @@ -146,8 +146,10 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) { log.Fatalf("Unable to create new kubectl client: %s", err.Error()) } + var shouldRebuild bool + if cmd.flags.build { - shouldRebuild := cmd.shouldRebuild(cobraCmd.Flags().Changed("build")) + shouldRebuild = cmd.shouldRebuild(cobraCmd.Flags().Changed("build")) if shouldRebuild { cmd.buildImage() @@ -164,7 +166,7 @@ func (cmd *UpCmd) Run(cobraCmd *cobra.Command, args []string) { } } - if cmd.flags.deploy { + if cmd.flags.deploy || shouldRebuild { cmd.deployChart() } else { cmd.initHelm() From 6b2391f70a2e921bf59a837650a83ced48a80552 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 6 Sep 2018 14:17:34 +0200 Subject: [PATCH 2/2] Fix test issue --- pkg/devspace/sync/sync_config_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/devspace/sync/sync_config_test.go b/pkg/devspace/sync/sync_config_test.go index b335b8b3c1..d76387b9b6 100644 --- a/pkg/devspace/sync/sync_config_test.go +++ b/pkg/devspace/sync/sync_config_test.go @@ -100,6 +100,8 @@ func createFileAndWait(from, to, postfix string) error { ioutil.WriteFile(filenameFrom, []byte(fileContents), 0666) for i := 0; i < 50; i++ { + time.Sleep(time.Millisecond * 100) + if _, err := os.Stat(filenameTo); err == nil { data, err := ioutil.ReadFile(filenameTo) if err != nil { @@ -111,8 +113,6 @@ func createFileAndWait(from, to, postfix string) error { return nil } - - time.Sleep(time.Millisecond * 100) } return fmt.Errorf("Created file %s wasn't correctly synced to %s", filenameFrom, filenameTo)