Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

When none set, generate a random installation name #609

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKDIR /go/src/github.com/docker/app/
# main dev image
FROM build AS dev
ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/
ARG DEP_VERSION=v0.5.1
ARG DEP_VERSION=v0.5.4
RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \
chmod +x /usr/bin/dep
ARG GOTESTSUM_VERSION=v0.3.4
Expand Down
2 changes: 2 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions internal/commands/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/docker/app/internal/store"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/pkg/namesgenerator"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -61,7 +62,7 @@ func installCmd(dockerCli command.Cli) *cobra.Command {
opts.pullOptions.addFlags(cmd.Flags())
cmd.Flags().StringVar(&opts.orchestrator, "orchestrator", "", "Orchestrator to install on (swarm, kubernetes)")
cmd.Flags().StringVar(&opts.kubeNamespace, "namespace", "default", "Kubernetes namespace to install into")
cmd.Flags().StringVar(&opts.stackName, "name", "", "Installation name (defaults to application name)")
cmd.Flags().StringVar(&opts.stackName, "name", "", "Assign a name to the installation")

return cmd
}
Expand All @@ -88,7 +89,7 @@ func runInstall(dockerCli command.Cli, appname string, opts installOptions) erro
}
installationName := opts.stackName
if installationName == "" {
installationName = bndl.Name
installationName = namesgenerator.GetRandomName(0)
}
logrus.Debugf(`Looking for a previous installation "%q"`, installationName)
if installation, err := installationStore.Read(installationName); err == nil {
Expand Down