Skip to content

Commit

Permalink
deprecate frontend/dockerfile/dockerignore
Browse files Browse the repository at this point in the history
This package was moved to github.com/moby/patternmatcher/ignorefile.
Mark the alias as deprecated.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 22, 2023
1 parent 439fb42 commit b30edad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/dockerfile/dockerignore/dockerignore_deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
)

// ReadAll is an alias for [ignorefile.ReadAll].
//
// Deprecated: use [ignorefile.ReadAll] instead.
func ReadAll(reader io.Reader) ([]string, error) {
return ignorefile.ReadAll(reader)
}
4 changes: 2 additions & 2 deletions frontend/dockerui/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/exporter/containerimage/image"
"github.com/moby/buildkit/frontend/attestations"
"github.com/moby/buildkit/frontend/dockerfile/dockerignore"
"github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/solver/pb"
"github.com/moby/buildkit/util/flightcontrol"
"github.com/moby/patternmatcher/ignorefile"
digest "github.com/opencontainers/go-digest"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down Expand Up @@ -442,7 +442,7 @@ func (bc *Client) MainContext(ctx context.Context, opts ...llb.LocalOption) (*ll

var excludes []string
if len(bc.dockerignore) != 0 {
excludes, err = dockerignore.ReadAll(bytes.NewBuffer(bc.dockerignore))
excludes, err = ignorefile.ReadAll(bytes.NewBuffer(bc.dockerignore))
if err != nil {
return nil, errors.Wrapf(err, "failed parsing %s", bc.dockerignoreName)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerui/namedcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/exporter/containerimage/image"
"github.com/moby/buildkit/frontend/dockerfile/dockerignore"
"github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/util/imageutil"
"github.com/moby/patternmatcher/ignorefile"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -206,7 +206,7 @@ func (bc *Client) namedContextRecursive(ctx context.Context, name string, nameWi
}) // error ignored

if len(dt) != 0 {
excludes, err = dockerignore.ReadAll(bytes.NewBuffer(dt))
excludes, err = ignorefile.ReadAll(bytes.NewBuffer(dt))
if err != nil {
return nil, nil, errors.Wrapf(err, "failed parsing %s", DefaultDockerignoreName)
}
Expand Down

0 comments on commit b30edad

Please sign in to comment.