@@ -34,7 +34,7 @@ type BuilderConfig struct {
3434
3535type Builder interface {
3636 Build (ctx context.Context , reg image.Registry , dir string , td TemplateDefinition ) error
37- Validate (dir string ) error
37+ Validate (ctx context. Context , dir string ) error
3838}
3939
4040type BasicBuilder struct {
@@ -94,8 +94,8 @@ func (bb *BasicBuilder) Build(ctx context.Context, reg image.Registry, dir strin
9494 return build (dcfg , destPath , bb .builderCfg .OutputType )
9595}
9696
97- func (bb * BasicBuilder ) Validate (dir string ) error {
98- return validate (bb .builderCfg , dir )
97+ func (bb * BasicBuilder ) Validate (ctx context. Context , dir string ) error {
98+ return validate (ctx , bb .builderCfg , dir )
9999}
100100
101101type SemverBuilder struct {
@@ -156,8 +156,8 @@ func (sb *SemverBuilder) Build(ctx context.Context, reg image.Registry, dir stri
156156 return build (dcfg , destPath , sb .builderCfg .OutputType )
157157}
158158
159- func (sb * SemverBuilder ) Validate (dir string ) error {
160- return validate (sb .builderCfg , dir )
159+ func (sb * SemverBuilder ) Validate (ctx context. Context , dir string ) error {
160+ return validate (ctx , sb .builderCfg , dir )
161161}
162162
163163type RawBuilder struct {
@@ -216,8 +216,8 @@ func (rb *RawBuilder) Build(ctx context.Context, _ image.Registry, dir string, t
216216 return build (dcfg , destPath , rb .builderCfg .OutputType )
217217}
218218
219- func (rb * RawBuilder ) Validate (dir string ) error {
220- return validate (rb .builderCfg , dir )
219+ func (rb * RawBuilder ) Validate (ctx context. Context , dir string ) error {
220+ return validate (ctx , rb .builderCfg , dir )
221221}
222222
223223type CustomBuilder struct {
@@ -285,8 +285,8 @@ func (cb *CustomBuilder) Build(ctx context.Context, reg image.Registry, dir stri
285285 return build (dcfg , destPath , cb .builderCfg .OutputType )
286286}
287287
288- func (cb * CustomBuilder ) Validate (dir string ) error {
289- return validate (cb .builderCfg , dir )
288+ func (cb * CustomBuilder ) Validate (ctx context. Context , dir string ) error {
289+ return validate (ctx , cb .builderCfg , dir )
290290}
291291
292292func writeDeclCfg (dcfg declcfg.DeclarativeConfig , w io.Writer , output string ) error {
@@ -300,7 +300,7 @@ func writeDeclCfg(dcfg declcfg.DeclarativeConfig, w io.Writer, output string) er
300300 }
301301}
302302
303- func validate (builderCfg BuilderConfig , dir string ) error {
303+ func validate (ctx context. Context , builderCfg BuilderConfig , dir string ) error {
304304
305305 path := path .Join (builderCfg .WorkingDir , dir )
306306 s , err := os .Stat (path )
@@ -311,7 +311,7 @@ func validate(builderCfg BuilderConfig, dir string) error {
311311 return fmt .Errorf ("%q is not a directory" , path )
312312 }
313313
314- if err := config .Validate (os .DirFS (path )); err != nil {
314+ if err := config .Validate (ctx , os .DirFS (path )); err != nil {
315315 return fmt .Errorf ("validation failure in path %q: %v" , path , err )
316316 }
317317 return nil
0 commit comments