@@ -23,9 +23,7 @@ const inspectExample = `- $ docker app inspect my-running-app
2323type inspectOptions struct {
2424 credentialOptions
2525 cliopts.InstallerContextOptions
26- pretty bool
27- orchestrator string
28- kubeNamespace string
26+ pretty bool
2927}
3028
3129func inspectCmd (dockerCli command.Cli ) * cobra.Command {
@@ -40,19 +38,12 @@ func inspectCmd(dockerCli command.Cli) *cobra.Command {
4038 },
4139 }
4240 cmd .Flags ().BoolVar (& opts .pretty , "pretty" , false , "Pretty print the output" )
43- cmd .Flags ().StringVar (& opts .orchestrator , "orchestrator" , "" , "Orchestrator where the App is running on (swarm, kubernetes)" )
44- cmd .Flags ().StringVar (& opts .kubeNamespace , "namespace" , "default" , "Kubernetes namespace in which to find the App" )
4541 opts .credentialOptions .addFlags (cmd .Flags ())
4642 opts .InstallerContextOptions .AddFlags (cmd .Flags ())
4743 return cmd
4844}
4945
5046func runInspect (dockerCli command.Cli , appName string , inspectOptions inspectOptions ) error {
51- orchestrator , err := getContextOrchestrator (dockerCli , inspectOptions .orchestrator )
52- if err != nil {
53- return err
54- }
55-
5647 defer muteDockerCli (dockerCli )()
5748 _ , installationStore , credentialStore , err := prepareStores (dockerCli .CurrentContext ())
5849 if err != nil {
@@ -63,11 +54,6 @@ func runInspect(dockerCli command.Cli, appName string, inspectOptions inspectOpt
6354 return err
6455 }
6556
66- orchestratorName , ok := installation .Parameters [internal .ParameterOrchestratorName ].(string )
67- if ! ok || orchestratorName == "" {
68- orchestratorName = string (orchestrator )
69- }
70-
7157 creds , err := prepareCredentialSet (installation .Bundle , inspectOptions .CredentialSetOpts (dockerCli , credentialStore )... )
7258 if err != nil {
7359 return err
@@ -94,7 +80,7 @@ func runInspect(dockerCli command.Cli, appName string, inspectOptions inspectOpt
9480 }
9581
9682 if inspectOptions .pretty {
97- if err := inspect .Inspect (os .Stdout , installation , "pretty" , orchestratorName ); err != nil {
83+ if err := inspect .Inspect (os .Stdout , installation , "pretty" ); err != nil {
9884 return err
9985 }
10086 fmt .Fprint (os .Stdout , buf .String ())
@@ -107,7 +93,7 @@ func runInspect(dockerCli command.Cli, appName string, inspectOptions inspectOpt
10793 AppInfo inspect.AppInfo `json:",omitempty"`
10894 Services interface {} `json:",omitempty"`
10995 }{
110- inspect .GetAppInfo (installation , orchestratorName ),
96+ inspect .GetAppInfo (installation ),
11197 statusJSON ,
11298 }, "" , " " )
11399 if err != nil {
@@ -118,19 +104,6 @@ func runInspect(dockerCli command.Cli, appName string, inspectOptions inspectOpt
118104 return nil
119105}
120106
121- func getContextOrchestrator (dockerCli command.Cli , orchestratorFlag string ) (command.Orchestrator , error ) {
122- var orchestrator command.Orchestrator
123- orchestrator , _ = command .NormalizeOrchestrator (orchestratorFlag )
124- if string (orchestrator ) == "" {
125- orchestrator , err := dockerCli .StackOrchestrator ("" )
126- if err != nil {
127- return "" , err
128- }
129- return orchestrator , nil
130- }
131- return orchestrator , nil
132- }
133-
134107func hasAction (bndl * bundle.Bundle , actionName string ) bool {
135108 for key := range bndl .Actions {
136109 if key == actionName {
0 commit comments