@@ -17,17 +17,13 @@ package bundle
17
17
import (
18
18
"context"
19
19
"fmt"
20
- "io/ioutil"
21
- "os"
22
20
"strings"
23
21
24
22
log "github.com/sirupsen/logrus"
25
23
"github.com/spf13/pflag"
26
24
27
25
"github.com/operator-framework/api/pkg/operators/v1alpha1"
28
- "github.com/operator-framework/operator-registry/alpha/action"
29
26
declarativeconfig "github.com/operator-framework/operator-registry/alpha/declcfg"
30
- "github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
31
27
registrybundle "github.com/operator-framework/operator-registry/pkg/lib/bundle"
32
28
fbcutil "github.com/operator-framework/operator-sdk/internal/olm/fbcutil"
33
29
"github.com/operator-framework/operator-sdk/internal/olm/operator"
@@ -191,26 +187,10 @@ func generateFBCContent(ctx context.Context, f *fbcutil.FBCContext, bundleImage,
191
187
// declarative config type.
192
188
func generateExtraFBC (ctx context.Context , indexImage string , bundleDeclConfig fbcutil.BundleDeclcfg , skipTLSVerify bool , useHTTP bool ) (* declarativeconfig.DeclarativeConfig , error ) {
193
189
log .Infof ("Rendering a File-Based Catalog of the Index Image %q to verify if bundle %q is present" , indexImage , bundleDeclConfig .Bundle .Name )
194
- log .SetOutput (ioutil .Discard )
195
-
196
- reg , err := containerdregistry .NewRegistry (
197
- containerdregistry .WithLog (fbcutil .NullLogger ()),
198
- containerdregistry .SkipTLSVerify (skipTLSVerify ),
199
- containerdregistry .WithPlainHTTP (useHTTP ))
200
190
191
+ imageDeclConfig , err := fbcutil .RenderRefs (ctx , []string {indexImage }, skipTLSVerify , useHTTP )
201
192
if err != nil {
202
- return nil , fmt .Errorf ("error creating new image registry: %v" , err )
203
- }
204
-
205
- render := action.Render {
206
- Refs : []string {indexImage },
207
- Registry : reg ,
208
- }
209
-
210
- imageDeclConfig , err := render .Run (ctx )
211
- log .SetOutput (os .Stdout )
212
- if err != nil {
213
- return nil , fmt .Errorf ("error rendering the index image %q: %v" , indexImage , err )
193
+ return nil , err
214
194
}
215
195
216
196
for _ , bundle := range imageDeclConfig .Bundles {
0 commit comments