@@ -23,12 +23,11 @@ import (
2323
2424type renderOptions struct {
2525 cliopts.ParametersOptions
26- cliopts.InstallerContextOptions
2726 formatDriver string
2827 renderOutput string
2928}
3029
31- func renderCmd (dockerCli command.Cli ) * cobra.Command {
30+ func renderCmd (dockerCli command.Cli , installerContext * cliopts. InstallerContextOptions ) * cobra.Command {
3231 var opts renderOptions
3332 cmd := & cobra.Command {
3433 Use : "render [OPTIONS] APP_IMAGE" ,
@@ -37,18 +36,17 @@ func renderCmd(dockerCli command.Cli) *cobra.Command {
3736 Args : cli .ExactArgs (1 ),
3837 Hidden : true ,
3938 RunE : func (cmd * cobra.Command , args []string ) error {
40- return runRender (dockerCli , args [0 ], opts )
39+ return runRender (dockerCli , args [0 ], opts , installerContext )
4140 },
4241 }
4342 opts .ParametersOptions .AddFlags (cmd .Flags ())
44- opts .InstallerContextOptions .AddFlags (cmd .Flags ())
4543 cmd .Flags ().StringVarP (& opts .renderOutput , "output" , "o" , "-" , "Output file" )
4644 cmd .Flags ().StringVar (& opts .formatDriver , "formatter" , "yaml" , "Configure the output format (yaml|json)" )
4745
4846 return cmd
4947}
5048
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 {
5250 defer muteDockerCli (dockerCli )()
5351
5452 var w io.Writer = os .Stdout
@@ -66,7 +64,7 @@ func runRender(dockerCli command.Cli, appname string, opts renderOptions) error
6664 return nil
6765 }
6866
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 )
7068 if err != nil {
7169 return err
7270 }
@@ -78,7 +76,13 @@ func runRender(dockerCli command.Cli, appname string, opts renderOptions) error
7876 return nil
7977}
8078
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+
8286 s , err := appstore .NewApplicationStore (config .Dir ())
8387 if err != nil {
8488 return nil , nil , nil , err
@@ -103,7 +107,7 @@ func prepareCustomAction(actionName string, dockerCli command.Cli, appname strin
103107 return nil , nil , nil , err
104108 }
105109
106- driverImpl , errBuf , err := cnab .SetupDriver (installation , dockerCli , opts . InstallerContextOptions , stdout )
110+ driverImpl , errBuf , err := cnab .SetupDriver (installation , dockerCli , installerContext , stdout )
107111 if err != nil {
108112 return nil , nil , nil , err
109113 }
0 commit comments