Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit ff3fd5b

Browse files
author
Mike Parker
committed
Review: Remove --keep-workdir flag, as it's a weird workflow and confusing. If there's a valid use case we can come back to it.
Signed-off-by: Mike Parker <michael.parker@docker.com>
1 parent aea9785 commit ff3fd5b

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

cmd/docker-app/deploy.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ import (
1818
)
1919

2020
type deployOptions struct {
21-
deployComposeFiles []string
22-
deploySettingsFiles []string
23-
deployEnv []string
24-
deployOrchestrator string
25-
deployKubeConfig string
26-
deployNamespace string
27-
deployStackName string
28-
deploySendRegistryAuth bool
29-
deployKeepWorkingDirectory bool
21+
deployComposeFiles []string
22+
deploySettingsFiles []string
23+
deployEnv []string
24+
deployOrchestrator string
25+
deployKubeConfig string
26+
deployNamespace string
27+
deployStackName string
28+
deploySendRegistryAuth bool
3029
}
3130

3231
// deployCmd represents the deploy command
@@ -50,7 +49,6 @@ func deployCmd(dockerCli command.Cli) *cobra.Command {
5049
cmd.Flags().StringVarP(&opts.deployNamespace, "namespace", "n", "default", "Kubernetes namespace to deploy into")
5150
cmd.Flags().StringVarP(&opts.deployStackName, "name", "d", "", "Stack name (default: app name)")
5251
cmd.Flags().BoolVarP(&opts.deploySendRegistryAuth, "with-registry-auth", "", false, "Sends registry auth")
53-
cmd.Flags().BoolVarP(&opts.deployKeepWorkingDirectory, "keep-workdir", "", false, "Keeps the working directory from where you ran the deploy command (rather than inside the dockerapp directory)")
5452
if internal.Experimental == "on" {
5553
cmd.Flags().StringArrayVarP(&opts.deployComposeFiles, "compose-files", "c", []string{}, "Override Compose files")
5654
}
@@ -79,8 +77,8 @@ func runDeploy(dockerCli command.Cli, flags *pflag.FlagSet, appname string, opts
7977
if stackName == "" {
8078
stackName = internal.AppNameFromDir(app.Name)
8179
}
82-
if !opts.deployKeepWorkingDirectory {
83-
os.Chdir(app.Path)
80+
if err := os.Chdir(app.Path); err != nil {
81+
return err
8482
}
8583
return stack.RunDeploy(dockerCli, flags, rendered, deployOrchestrator, options.Deploy{
8684
Namespace: stackName,

0 commit comments

Comments
 (0)