@@ -8,17 +8,13 @@ import (
8
8
9
9
"k8s.io/apimachinery/pkg/util/yaml"
10
10
11
- "github.com/operator-framework/operator-registry/alpha/action"
12
- "github.com/operator-framework/operator-registry/alpha/action/migrations"
13
11
"github.com/operator-framework/operator-registry/alpha/declcfg"
14
- "github.com/operator-framework/operator-registry/pkg/image"
15
12
)
16
13
17
14
const schema string = "olm.template.basic"
18
15
19
16
type Template struct {
20
- Registry image.Registry
21
- Migrations * migrations.Migrations
17
+ RenderBundle func (context.Context , string ) (* declcfg.DeclarativeConfig , error )
22
18
}
23
19
24
20
type BasicTemplate struct {
@@ -57,19 +53,11 @@ func (t Template) Render(ctx context.Context, reader io.Reader) (*declcfg.Declar
57
53
}
58
54
59
55
outb := cfg .Bundles [:0 ]
60
- // populate registry, incl any flags from CLI, and enforce only rendering bundle images
61
- r := action.Render {
62
- Registry : t .Registry ,
63
- AllowedRefMask : action .RefBundleImage ,
64
- Migrations : t .Migrations ,
65
- }
66
-
67
56
for _ , b := range cfg .Bundles {
68
57
if ! isBundleTemplate (& b ) {
69
58
return nil , fmt .Errorf ("unexpected fields present in basic template bundle" )
70
59
}
71
- r .Refs = []string {b .Image }
72
- contributor , err := r .Run (ctx )
60
+ contributor , err := t .RenderBundle (ctx , b .Image )
73
61
if err != nil {
74
62
return nil , err
75
63
}
0 commit comments