@@ -22,7 +22,6 @@ import (
2222
2323type bundleOptions struct {
2424 invocationImageName string
25- namespace string
2625 out string
2726}
2827
@@ -38,13 +37,12 @@ func bundleCmd(dockerCli command.Cli) *cobra.Command {
3837 }
3938
4039 cmd .Flags ().StringVarP (& opts .invocationImageName , "invocation-image" , "i" , "" , "specify the name of invocation image to build" )
41- cmd .Flags ().StringVar (& opts .namespace , "namespace" , "" , "namespace to use (default: namespace in metadata)" )
4240 cmd .Flags ().StringVarP (& opts .out , "out" , "o" , "bundle.json" , "path to the output bundle.json (- for stdout)" )
4341 return cmd
4442}
4543
4644func runBundle (dockerCli command.Cli , appName string , opts bundleOptions ) error {
47- bundle , err := makeBundle (dockerCli , appName , opts .namespace , opts . invocationImageName )
45+ bundle , err := makeBundle (dockerCli , appName , opts .invocationImageName )
4846 if err != nil {
4947 return err
5048 }
@@ -63,22 +61,22 @@ func runBundle(dockerCli command.Cli, appName string, opts bundleOptions) error
6361 return ioutil .WriteFile (opts .out , bundleBytes , 0644 )
6462}
6563
66- func makeBundle (dockerCli command.Cli , appName , namespace , invocationImageName string ) (* bundle.Bundle , error ) {
64+ func makeBundle (dockerCli command.Cli , appName , invocationImageName string ) (* bundle.Bundle , error ) {
6765 app , err := packager .Extract (appName )
6866 if err != nil {
6967 return nil , err
7068 }
7169 defer app .Cleanup ()
72- return makeBundleFromApp (dockerCli , app , namespace , invocationImageName )
70+ return makeBundleFromApp (dockerCli , app , invocationImageName )
7371}
7472
75- func makeBundleFromApp (dockerCli command.Cli , app * types.App , namespace , invocationImageName string ) (* bundle.Bundle , error ) {
73+ func makeBundleFromApp (dockerCli command.Cli , app * types.App , invocationImageName string ) (* bundle.Bundle , error ) {
7674 meta := app .Metadata ()
77- invocationImageName , err := makeImageName (meta , namespace , invocationImageName , "-invoc" )
75+ invocationImageName , err := makeImageName (meta , invocationImageName , "-invoc" )
7876 if err != nil {
7977 return nil , err
8078 }
81- if _ , err := makeImageName (app .Metadata (), namespace , "" , "" ); err != nil {
79+ if _ , err := makeImageName (app .Metadata (), "" , "" ); err != nil {
8280 return nil , err
8381 }
8482
@@ -102,16 +100,10 @@ func makeBundleFromApp(dockerCli command.Cli, app *types.App, namespace, invocat
102100 return packager .ToCNAB (app , invocationImageName )
103101}
104102
105- func makeImageName (meta metadata.AppMetadata , namespace , name , suffix string ) (string , error ) {
103+ func makeImageName (meta metadata.AppMetadata , name , suffix string ) (string , error ) {
106104 if name == "" {
107105 name = fmt .Sprintf ("%s:%s%s" , meta .Name , meta .Version , suffix )
108106 }
109- if namespace == "" {
110- namespace = meta .Namespace
111- }
112- if namespace != "" {
113- name = fmt .Sprintf ("%s/%s" , namespace , name )
114- }
115107 if _ , err := reference .ParseNormalizedNamed (name ); err != nil {
116108 return "" , errors .Wrapf (err , "image name %q is invalid, please check namespace, name and version fields" , name )
117109 }
0 commit comments