diff --git a/pkg/cli/run.go b/pkg/cli/run.go index 99c15335f..147502f35 100644 --- a/pkg/cli/run.go +++ b/pkg/cli/run.go @@ -271,7 +271,10 @@ func (s *Run) Run(cmd *cobra.Command, args []string) error { if s.Interactive { return fmt.Errorf("cannot use --update/-u or --replace/-r with --dev/-i") } - return updateHelper(cmd, args, s, c, isDir, cwd) + //if app does not exist but --update/--replace flag is used create app instead + if existingApp != nil { + return updateHelper(cmd, args, s, c, isDir, cwd) + } } if s.Interactive { diff --git a/pkg/cli/run_test.go b/pkg/cli/run_test.go index 64823e286..7ff1663f3 100644 --- a/pkg/cli/run_test.go +++ b/pkg/cli/run_test.go @@ -285,8 +285,6 @@ func TestRun(t *testing.T) { Spec: apiv1.InfoSpec{}, }, }, nil) - f.EXPECT().ImageDetails(gomock.Any(), gomock.Any(), gomock.Any()).Return( - nil, fmt.Errorf("error: app image-dne does not exist")) }, }, {