@@ -34,7 +34,7 @@ type BuilderConfig struct {
34
34
35
35
type Builder interface {
36
36
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
38
38
}
39
39
40
40
type BasicBuilder struct {
@@ -94,8 +94,8 @@ func (bb *BasicBuilder) Build(ctx context.Context, reg image.Registry, dir strin
94
94
return build (dcfg , destPath , bb .builderCfg .OutputType )
95
95
}
96
96
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 )
99
99
}
100
100
101
101
type SemverBuilder struct {
@@ -156,8 +156,8 @@ func (sb *SemverBuilder) Build(ctx context.Context, reg image.Registry, dir stri
156
156
return build (dcfg , destPath , sb .builderCfg .OutputType )
157
157
}
158
158
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 )
161
161
}
162
162
163
163
type RawBuilder struct {
@@ -216,8 +216,8 @@ func (rb *RawBuilder) Build(ctx context.Context, _ image.Registry, dir string, t
216
216
return build (dcfg , destPath , rb .builderCfg .OutputType )
217
217
}
218
218
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 )
221
221
}
222
222
223
223
type CustomBuilder struct {
@@ -285,8 +285,8 @@ func (cb *CustomBuilder) Build(ctx context.Context, reg image.Registry, dir stri
285
285
return build (dcfg , destPath , cb .builderCfg .OutputType )
286
286
}
287
287
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 )
290
290
}
291
291
292
292
func 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
300
300
}
301
301
}
302
302
303
- func validate (builderCfg BuilderConfig , dir string ) error {
303
+ func validate (ctx context. Context , builderCfg BuilderConfig , dir string ) error {
304
304
305
305
path := path .Join (builderCfg .WorkingDir , dir )
306
306
s , err := os .Stat (path )
@@ -311,7 +311,7 @@ func validate(builderCfg BuilderConfig, dir string) error {
311
311
return fmt .Errorf ("%q is not a directory" , path )
312
312
}
313
313
314
- if err := config .Validate (os .DirFS (path )); err != nil {
314
+ if err := config .Validate (ctx , os .DirFS (path )); err != nil {
315
315
return fmt .Errorf ("validation failure in path %q: %v" , path , err )
316
316
}
317
317
return nil
0 commit comments