@@ -23,12 +23,11 @@ import (
23
23
24
24
type renderOptions struct {
25
25
cliopts.ParametersOptions
26
- cliopts.InstallerContextOptions
27
26
formatDriver string
28
27
renderOutput string
29
28
}
30
29
31
- func renderCmd (dockerCli command.Cli ) * cobra.Command {
30
+ func renderCmd (dockerCli command.Cli , installerContext * cliopts. InstallerContextOptions ) * cobra.Command {
32
31
var opts renderOptions
33
32
cmd := & cobra.Command {
34
33
Use : "render [OPTIONS] APP_IMAGE" ,
@@ -37,18 +36,17 @@ func renderCmd(dockerCli command.Cli) *cobra.Command {
37
36
Args : cli .ExactArgs (1 ),
38
37
Hidden : true ,
39
38
RunE : func (cmd * cobra.Command , args []string ) error {
40
- return runRender (dockerCli , args [0 ], opts )
39
+ return runRender (dockerCli , args [0 ], opts , installerContext )
41
40
},
42
41
}
43
42
opts .ParametersOptions .AddFlags (cmd .Flags ())
44
- opts .InstallerContextOptions .AddFlags (cmd .Flags ())
45
43
cmd .Flags ().StringVarP (& opts .renderOutput , "output" , "o" , "-" , "Output file" )
46
44
cmd .Flags ().StringVar (& opts .formatDriver , "formatter" , "yaml" , "Configure the output format (yaml|json)" )
47
45
48
46
return cmd
49
47
}
50
48
51
- func runRender (dockerCli command.Cli , appname string , opts renderOptions ) error {
49
+ func runRender (dockerCli command.Cli , appname string , opts renderOptions , installerContext * cliopts. InstallerContextOptions ) error {
52
50
defer muteDockerCli (dockerCli )()
53
51
54
52
var w io.Writer = os .Stdout
@@ -66,7 +64,7 @@ func runRender(dockerCli command.Cli, appname string, opts renderOptions) error
66
64
return nil
67
65
}
68
66
69
- action , installation , errBuf , err := prepareCustomAction (internal .ActionRenderName , dockerCli , appname , w , opts )
67
+ action , installation , errBuf , err := prepareCustomAction (internal .ActionRenderName , dockerCli , appname , w , opts , installerContext )
70
68
if err != nil {
71
69
return err
72
70
}
@@ -78,7 +76,13 @@ func runRender(dockerCli command.Cli, appname string, opts renderOptions) error
78
76
return nil
79
77
}
80
78
81
- func prepareCustomAction (actionName string , dockerCli command.Cli , appname string , stdout io.Writer , opts renderOptions ) (* action.RunCustom , * appstore.Installation , * bytes.Buffer , error ) {
79
+ func prepareCustomAction (actionName string ,
80
+ dockerCli command.Cli ,
81
+ appname string ,
82
+ stdout io.Writer ,
83
+ opts renderOptions ,
84
+ installerContext * cliopts.InstallerContextOptions ) (* action.RunCustom , * appstore.Installation , * bytes.Buffer , error ) {
85
+
82
86
s , err := appstore .NewApplicationStore (config .Dir ())
83
87
if err != nil {
84
88
return nil , nil , nil , err
@@ -103,7 +107,7 @@ func prepareCustomAction(actionName string, dockerCli command.Cli, appname strin
103
107
return nil , nil , nil , err
104
108
}
105
109
106
- driverImpl , errBuf , err := cnab .SetupDriver (installation , dockerCli , opts . InstallerContextOptions , stdout )
110
+ driverImpl , errBuf , err := cnab .SetupDriver (installation , dockerCli , installerContext , stdout )
107
111
if err != nil {
108
112
return nil , nil , nil , err
109
113
}
0 commit comments