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

Commit daa2241

Browse files
* Add Install command to install any CNAB bundle.
Install command also detects if the argument is a Docker Application Package. It will then bundle it and run the CNAB action Install. It is now a CNAB installer, and all the docker-app deployment logic is moved to the docker-app backend binary run in cmd/run/install.go. The installation is added in the duffle claim store. * Rename deploy command to install (with still alias to deploy) Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1 parent 8574b9a commit daa2241

3 files changed

Lines changed: 12 additions & 103 deletions

File tree

cmd/docker-app/deploy.go

Lines changed: 0 additions & 90 deletions
This file was deleted.

cmd/docker-app/install.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"path/filepath"
88
"strings"
99

10-
"github.com/deis/duffle/pkg/action"
11-
"github.com/deis/duffle/pkg/bundle"
12-
"github.com/deis/duffle/pkg/claim"
13-
"github.com/deis/duffle/pkg/credentials"
14-
"github.com/deis/duffle/pkg/driver"
15-
"github.com/deis/duffle/pkg/duffle/home"
16-
"github.com/deis/duffle/pkg/loader"
17-
"github.com/deis/duffle/pkg/utils/crud"
10+
"github.com/deislabs/duffle/pkg/action"
11+
"github.com/deislabs/duffle/pkg/bundle"
12+
"github.com/deislabs/duffle/pkg/claim"
13+
"github.com/deislabs/duffle/pkg/credentials"
14+
"github.com/deislabs/duffle/pkg/driver"
15+
"github.com/deislabs/duffle/pkg/duffle/home"
16+
"github.com/deislabs/duffle/pkg/loader"
17+
"github.com/deislabs/duffle/pkg/utils/crud"
1818
"github.com/docker/app/internal"
1919
"github.com/docker/app/internal/packager"
2020
"github.com/docker/app/types/parameters"
@@ -85,7 +85,7 @@ func installCmd(dockerCli command.Cli) *cobra.Command {
8585
opts.parametersOptions.addFlags(cmd.Flags())
8686
cmd.Flags().StringVarP(&opts.orchestrator, "orchestrator", "o", "", "Orchestrator to install on (swarm, kubernetes)")
8787
cmd.Flags().StringVar(&opts.namespace, "namespace", "", "Namespace to use (default: namespace in metadata)")
88-
cmd.Flags().StringVar(&opts.kubeNamespace, "kube-namespace", "default", "Kubernetes namespace to install into")
88+
cmd.Flags().StringVar(&opts.kubeNamespace, "kubernetes-namespace", "default", "Kubernetes namespace to install into")
8989
cmd.Flags().StringVar(&opts.stackName, "name", "", "Installation name (defaults to application name)")
9090
cmd.Flags().StringVar(&opts.targetContext, "target-context", "", "Context on which to install the application")
9191
cmd.Flags().BoolVar(&opts.insecure, "insecure", false, "Use insecure registry, without SSL")
@@ -248,8 +248,7 @@ func resolveBundle(dockerCli command.Cli, namespace, name string, insecure bool)
248248
case nameKindDir, nameKindEmpty:
249249
return extractAndLoadAppBasedBundle(dockerCli, namespace, name)
250250
case nameKindReference:
251-
// revert to local duffle bundle store or pull the bundle image
252-
return pullBundle(dockerCli, name, false, insecure)
251+
// TODO: pull the bundle
253252
}
254253
return nil, fmt.Errorf("could not resolve bundle %q", name)
255254
}
@@ -262,7 +261,7 @@ func getTargetContext(optstargetContext string) string {
262261
case os.Getenv("DOCKER_TARGET_CONTEXT") != "":
263262
targetContext = os.Getenv("DOCKER_TARGET_CONTEXT")
264263
}
265-
if targetContext == command.ContextDockerHost {
264+
if targetContext == "default" {
266265
targetContext = ""
267266
}
268267
return targetContext

cmd/docker-app/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func newRootCmd(dockerCli *command.DockerCli) *cobra.Command {
4444
// addCommands adds all the commands from cli/command to the root command
4545
func addCommands(cmd *cobra.Command, dockerCli command.Cli) {
4646
cmd.AddCommand(
47-
deployCmd(dockerCli),
47+
installCmd(dockerCli),
4848
initCmd(),
4949
inspectCmd(dockerCli),
5050
mergeCmd(dockerCli),

0 commit comments

Comments
 (0)