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

Commit fb71be0

Browse files
authored
Merge pull request #609 from ndeloof/defaultname
When none set, generate a random installation name
2 parents 5b857bc + 0df017d commit fb71be0

File tree

4 files changed

+859
-3
lines changed

4 files changed

+859
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WORKDIR /go/src/github.com/docker/app/
1919
# main dev image
2020
FROM build AS dev
2121
ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/
22-
ARG DEP_VERSION=v0.5.1
22+
ARG DEP_VERSION=v0.5.4
2323
RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \
2424
chmod +x /usr/bin/dep
2525
ARG GOTESTSUM_VERSION=v0.3.4

Gopkg.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/commands/install.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/docker/app/internal/store"
1010
"github.com/docker/cli/cli"
1111
"github.com/docker/cli/cli/command"
12+
"github.com/docker/docker/pkg/namesgenerator"
1213
"github.com/sirupsen/logrus"
1314
"github.com/spf13/cobra"
1415
)
@@ -61,7 +62,7 @@ func installCmd(dockerCli command.Cli) *cobra.Command {
6162
opts.pullOptions.addFlags(cmd.Flags())
6263
cmd.Flags().StringVar(&opts.orchestrator, "orchestrator", "", "Orchestrator to install on (swarm, kubernetes)")
6364
cmd.Flags().StringVar(&opts.kubeNamespace, "namespace", "default", "Kubernetes namespace to install into")
64-
cmd.Flags().StringVar(&opts.stackName, "name", "", "Installation name (defaults to application name)")
65+
cmd.Flags().StringVar(&opts.stackName, "name", "", "Assign a name to the installation")
6566

6667
return cmd
6768
}
@@ -88,7 +89,7 @@ func runInstall(dockerCli command.Cli, appname string, opts installOptions) erro
8889
}
8990
installationName := opts.stackName
9091
if installationName == "" {
91-
installationName = bndl.Name
92+
installationName = namesgenerator.GetRandomName(0)
9293
}
9394
logrus.Debugf(`Looking for a previous installation "%q"`, installationName)
9495
if installation, err := installationStore.Read(installationName); err == nil {

0 commit comments

Comments
 (0)