@@ -164,7 +164,7 @@ func generateFBCContent(ctx context.Context, f *fbcutil.FBCContext, bundleImage,
164
164
if indexImage != fbcutil .DefaultIndexImage { // non-default index image was specified.
165
165
// since an index image is specified, the bundle image will be added to the index image.
166
166
// 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 )
168
168
if err != nil {
169
169
return "" , fmt .Errorf ("error adding bundle image %q to index image %q: %v" , bundleImage , indexImage , err )
170
170
}
@@ -181,9 +181,9 @@ func generateFBCContent(ctx context.Context, f *fbcutil.FBCContext, bundleImage,
181
181
return content , nil
182
182
}
183
183
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
185
185
// 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 ) {
187
187
log .Infof ("Rendering a File-Based Catalog of the Index Image %q to verify if bundle %q is present" , indexImage , bundleDeclConfig .Bundle .Name )
188
188
189
189
imageDeclConfig , err := fbcutil .RenderRefs (ctx , []string {indexImage }, skipTLSVerify , useHTTP )
@@ -212,12 +212,12 @@ func generateExtraFBC(ctx context.Context, indexImage string, bundleDeclConfig f
212
212
}
213
213
214
214
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 ) ,
217
217
}
218
218
219
219
if ! isPackagePresent {
220
- extraDeclConfig .Packages = []declarativeconfig. Package { bundleDeclConfig .Package }
220
+ extraDeclConfig .Packages = append ( imageDeclConfig . Packages , bundleDeclConfig .Package )
221
221
}
222
222
223
223
log .Infof ("Generated the extra FBC for the bundle image %q" , bundleDeclConfig .Bundle .Name )
0 commit comments