mirror of https://github.com/knative/func.git
chore: removed deprecated types (#2378)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
This commit is contained in:
parent
398610de93
commit
f249714bfe
|
@ -24,8 +24,8 @@ import (
|
|||
"github.com/buildpacks/pack/buildpackage"
|
||||
pack "github.com/buildpacks/pack/pkg/client"
|
||||
"github.com/buildpacks/pack/pkg/dist"
|
||||
"github.com/buildpacks/pack/pkg/image"
|
||||
"github.com/docker/docker/api/types"
|
||||
bpimage "github.com/buildpacks/pack/pkg/image"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
docker "github.com/docker/docker/client"
|
||||
"github.com/docker/docker/pkg/jsonmessage"
|
||||
|
@ -138,7 +138,7 @@ func buildBuilderImage(ctx context.Context, variant string) error {
|
|||
BuilderName: newBuilderImageTagged,
|
||||
Config: builderConfig,
|
||||
Publish: false,
|
||||
PullPolicy: image.PullIfNotPresent,
|
||||
PullPolicy: bpimage.PullIfNotPresent,
|
||||
Labels: map[string]string{
|
||||
"org.opencontainers.image.description": "Paketo Jammy builder enriched with Rust and Func-Go buildpacks.",
|
||||
"org.opencontainers.image.source": "https://github.com/knative/func",
|
||||
|
@ -170,7 +170,7 @@ func buildBuilderImage(ctx context.Context, variant string) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("cannot marshal credentials: %w", err)
|
||||
}
|
||||
imagePushOptions := types.ImagePushOptions{
|
||||
imagePushOptions := image.PushOptions{
|
||||
All: false,
|
||||
RegistryAuth: base64.StdEncoding.EncodeToString(bs),
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ func buildBuildpackImage(ctx context.Context, bp buildpack) error {
|
|||
Format: pack.FormatImage,
|
||||
Config: cfg,
|
||||
Publish: false,
|
||||
PullPolicy: image.PullIfNotPresent,
|
||||
PullPolicy: bpimage.PullIfNotPresent,
|
||||
Registry: "",
|
||||
Flatten: false,
|
||||
FlattenExclude: nil,
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
|
||||
fn "knative.dev/func/pkg/functions"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/docker/docker/pkg/jsonmessage"
|
||||
|
@ -43,7 +43,7 @@ type CredentialsProvider func(ctx context.Context, image string) (Credentials, e
|
|||
// PusherDockerClient is sub-interface of client.CommonAPIClient required by pusher.
|
||||
type PusherDockerClient interface {
|
||||
daemon.Client
|
||||
ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
|
||||
ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
|
||||
Close() error
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ func (n *Pusher) daemonPush(ctx context.Context, f fn.Function, credentials Cred
|
|||
return "", err
|
||||
}
|
||||
|
||||
opts := types.ImagePushOptions{RegistryAuth: base64.StdEncoding.EncodeToString(b)}
|
||||
opts := image.PushOptions{RegistryAuth: base64.StdEncoding.EncodeToString(b)}
|
||||
|
||||
r, err := cli.ImagePush(ctx, f.Build.Image, opts)
|
||||
if err != nil {
|
||||
|
|
|
@ -115,7 +115,7 @@ func TestPush(t *testing.T) {
|
|||
|
||||
dockerClient := newMockPusherDockerClient()
|
||||
|
||||
pushReachable := func(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
pushReachable := func(ctx context.Context, ref string, options api.PushOptions) (io.ReadCloser, error) {
|
||||
if ref != functionImageRemote {
|
||||
return nil, fmt.Errorf("unexpected ref")
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ func TestPush(t *testing.T) {
|
|||
`)), nil
|
||||
}
|
||||
|
||||
pushUnreachable := func(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
pushUnreachable := func(ctx context.Context, ref string, options api.PushOptions) (io.ReadCloser, error) {
|
||||
return io.NopCloser(strings.NewReader(`{"errorDetail": {"message": "...no such host..."}}`)), nil
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ func TestPush(t *testing.T) {
|
|||
|
||||
func newMockPusherDockerClient() *mockPusherDockerClient {
|
||||
return &mockPusherDockerClient{
|
||||
imagePush: func(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
imagePush: func(ctx context.Context, ref string, options api.PushOptions) (io.ReadCloser, error) {
|
||||
return nil, fmt.Errorf(" imagePush not implemented")
|
||||
},
|
||||
imageSave: func(ctx context.Context, strings []string) (io.ReadCloser, error) {
|
||||
|
@ -286,7 +286,7 @@ func newMockPusherDockerClient() *mockPusherDockerClient {
|
|||
|
||||
type mockPusherDockerClient struct {
|
||||
negotiateAPIVersion func(ctx context.Context)
|
||||
imagePush func(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
|
||||
imagePush func(ctx context.Context, ref string, options api.PushOptions) (io.ReadCloser, error)
|
||||
imageSave func(ctx context.Context, strings []string) (io.ReadCloser, error)
|
||||
imageInspect func(ctx context.Context, s string) (types.ImageInspect, []byte, error)
|
||||
close func() error
|
||||
|
@ -312,7 +312,7 @@ func (m *mockPusherDockerClient) ImageInspectWithRaw(ctx context.Context, s stri
|
|||
return m.imageInspect(ctx, s)
|
||||
}
|
||||
|
||||
func (m *mockPusherDockerClient) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
func (m *mockPusherDockerClient) ImagePush(ctx context.Context, ref string, options api.PushOptions) (io.ReadCloser, error) {
|
||||
return m.imagePush(ctx, ref, options)
|
||||
}
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ func (c *closeGuardingClient) ImageBuild(arg0 context.Context, arg1 io.Reader, a
|
|||
return c.pimpl.ImageBuild(arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImageCreate(arg0 context.Context, arg1 string, arg2 types.ImageCreateOptions) (io.ReadCloser, error) {
|
||||
func (c *closeGuardingClient) ImageCreate(arg0 context.Context, arg1 string, arg2 image.CreateOptions) (io.ReadCloser, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
@ -469,7 +469,7 @@ func (c *closeGuardingClient) ImageHistory(arg0 context.Context, arg1 string) ([
|
|||
return c.pimpl.ImageHistory(arg0, arg1)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImageImport(arg0 context.Context, arg1 types.ImageImportSource, arg2 string, arg3 types.ImageImportOptions) (io.ReadCloser, error) {
|
||||
func (c *closeGuardingClient) ImageImport(arg0 context.Context, arg1 types.ImageImportSource, arg2 string, arg3 image.ImportOptions) (io.ReadCloser, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
@ -487,7 +487,7 @@ func (c *closeGuardingClient) ImageInspectWithRaw(arg0 context.Context, arg1 str
|
|||
return c.pimpl.ImageInspectWithRaw(arg0, arg1)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImageList(arg0 context.Context, arg1 types.ImageListOptions) ([]image.Summary, error) {
|
||||
func (c *closeGuardingClient) ImageList(arg0 context.Context, arg1 image.ListOptions) ([]image.Summary, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
@ -505,7 +505,7 @@ func (c *closeGuardingClient) ImageLoad(arg0 context.Context, arg1 io.Reader, ar
|
|||
return c.pimpl.ImageLoad(arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImagePull(arg0 context.Context, arg1 string, arg2 types.ImagePullOptions) (io.ReadCloser, error) {
|
||||
func (c *closeGuardingClient) ImagePull(arg0 context.Context, arg1 string, arg2 image.PullOptions) (io.ReadCloser, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
@ -514,7 +514,7 @@ func (c *closeGuardingClient) ImagePull(arg0 context.Context, arg1 string, arg2
|
|||
return c.pimpl.ImagePull(arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImagePush(arg0 context.Context, arg1 string, arg2 types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
func (c *closeGuardingClient) ImagePush(arg0 context.Context, arg1 string, arg2 image.PushOptions) (io.ReadCloser, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
@ -523,7 +523,7 @@ func (c *closeGuardingClient) ImagePush(arg0 context.Context, arg1 string, arg2
|
|||
return c.pimpl.ImagePush(arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
func (c *closeGuardingClient) ImageRemove(arg0 context.Context, arg1 string, arg2 types.ImageRemoveOptions) ([]image.DeleteResponse, error) {
|
||||
func (c *closeGuardingClient) ImageRemove(arg0 context.Context, arg1 string, arg2 image.RemoveOptions) ([]image.DeleteResponse, error) {
|
||||
c.m.RLock()
|
||||
defer c.m.RUnlock()
|
||||
if c.closed {
|
||||
|
|
Loading…
Reference in New Issue