@@ -164,7 +164,7 @@ func generateFBCContent(ctx context.Context, f *fbcutil.FBCContext, bundleImage,
164164 if indexImage != fbcutil .DefaultIndexImage { // non-default index image was specified.
165165 // since an index image is specified, the bundle image will be added to the index image.
166166 // generateExtraFBC will ensure that the bundle is not already present in the index image and error out if it does.
167- declcfg , err = generateExtraFBC (ctx , indexImage , bundleDeclcfg , f .SkipTLSVerify , f .UseHTTP )
167+ declcfg , err = generateFBC (ctx , indexImage , bundleDeclcfg , f .SkipTLSVerify , f .UseHTTP )
168168 if err != nil {
169169 return "" , fmt .Errorf ("error adding bundle image %q to index image %q: %v" , bundleImage , indexImage , err )
170170 }
@@ -181,9 +181,9 @@ func generateFBCContent(ctx context.Context, f *fbcutil.FBCContext, bundleImage,
181181 return content , nil
182182}
183183
184- // generateExtraFBC verifies that a bundle is not already present on the index and if not, it renders the bundle contents into a
184+ // generateFBC verifies that a bundle is not already present on the index and if not, it renders the bundle contents into a
185185// declarative config type.
186- func generateExtraFBC (ctx context.Context , indexImage string , bundleDeclConfig fbcutil.BundleDeclcfg , skipTLSVerify bool , useHTTP bool ) (* declarativeconfig.DeclarativeConfig , error ) {
186+ func generateFBC (ctx context.Context , indexImage string , bundleDeclConfig fbcutil.BundleDeclcfg , skipTLSVerify bool , useHTTP bool ) (* declarativeconfig.DeclarativeConfig , error ) {
187187 log .Infof ("Rendering a File-Based Catalog of the Index Image %q to verify if bundle %q is present" , indexImage , bundleDeclConfig .Bundle .Name )
188188
189189 imageDeclConfig , err := fbcutil .RenderRefs (ctx , []string {indexImage }, skipTLSVerify , useHTTP )
@@ -212,12 +212,12 @@ func generateExtraFBC(ctx context.Context, indexImage string, bundleDeclConfig f
212212 }
213213
214214 extraDeclConfig := & declarativeconfig.DeclarativeConfig {
215- Bundles : []declarativeconfig. Bundle { bundleDeclConfig .Bundle } ,
216- Channels : []declarativeconfig. Channel { bundleDeclConfig .Channel } ,
215+ Bundles : append ( imageDeclConfig . Bundles , bundleDeclConfig .Bundle ) ,
216+ Channels : append ( imageDeclConfig . Channels , bundleDeclConfig .Channel ) ,
217217 }
218218
219219 if ! isPackagePresent {
220- extraDeclConfig .Packages = []declarativeconfig. Package { bundleDeclConfig .Package }
220+ extraDeclConfig .Packages = append ( imageDeclConfig . Packages , bundleDeclConfig .Package )
221221 }
222222
223223 log .Infof ("Generated the extra FBC for the bundle image %q" , bundleDeclConfig .Bundle .Name )
0 commit comments