Fix optional/pointer indirection errors

This commit is contained in:
Bryce Lampe
2024-04-16 13:03:21 -07:00
parent 59fd3c84e5
commit eca03ce6db
15 changed files with 138 additions and 90 deletions

View File

@@ -54,7 +54,7 @@ func (d *Dockerfile) Annotate(a infer.Annotator) {
`))
}
func (d *Dockerfile) validate(preview bool, c Context) error {
func (d *Dockerfile) validate(preview bool, c *Context) error {
if d.Location != "" && d.Inline != "" {
return newCheckFailure(
errors.New(`only specify "file" or "inline", not both`),
@@ -88,7 +88,7 @@ func (d *Dockerfile) validate(preview bool, c Context) error {
return nil
}
if !preview && !buildx.IsRemoteURL(c.Location) {
if !preview && c != nil && !buildx.IsRemoteURL(c.Location) {
return newCheckFailure(errors.New("missing 'location' or 'inline'"), "dockerfile")
}