Skip to content

Commit

Permalink
Update to v1.26.0-rc.0
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <[email protected]>
  • Loading branch information
galal-hussein committed Nov 22, 2022
1 parent d6cb76f commit 7abf2e5
Show file tree
Hide file tree
Showing 55 changed files with 378 additions and 304 deletions.
2 changes: 1 addition & 1 deletion backend/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/sirupsen/logrus"
"google.golang.org/grpc"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/kubernetes/pkg/kubelet/util"

"github.com/Mirantis/cri-dockerd/core"
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/pflag"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions core/container_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package core

import (
"context"

"github.com/Mirantis/cri-dockerd/libdocker"
"github.com/Mirantis/cri-dockerd/streaming"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Attach prepares a streaming endpoint to attach to a running container, and returns the address.
Expand All @@ -37,4 +38,3 @@ func (ds *dockerService) Attach(
}
return ds.streamingServer.GetAttach(req)
}

6 changes: 3 additions & 3 deletions core/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ package core
import (
"context"
"fmt"
"path/filepath"

"github.com/Mirantis/cri-dockerd/libdocker"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/strslice"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"path/filepath"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// CreateContainer creates a new container in the given PodSandbox
Expand Down Expand Up @@ -159,4 +160,3 @@ func (ds *dockerService) CreateContainer(

return nil, createErr
}

6 changes: 3 additions & 3 deletions core/container_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import (
"bytes"
"context"
"fmt"
"time"

"github.com/Mirantis/cri-dockerd/libdocker"
"github.com/Mirantis/cri-dockerd/streaming"
"github.com/Mirantis/cri-dockerd/utils"
"google.golang.org/grpc/codes"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"time"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ExecSync executes a command in the container, and returns the stdout output.
Expand Down Expand Up @@ -79,4 +80,3 @@ func (ds *dockerService) Exec(
}
return ds.streamingServer.GetExec(req)
}

3 changes: 2 additions & 1 deletion core/container_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package core

import (
"context"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/sirupsen/logrus"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ListContainers lists all containers matching the filter.
Expand Down
7 changes: 4 additions & 3 deletions core/container_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package core
import (
"context"
"fmt"
"time"

"github.com/Mirantis/cri-dockerd/libdocker"
"github.com/docker/docker/api/types"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"time"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// RemoveContainer removes the container.
Expand Down Expand Up @@ -92,4 +93,4 @@ func getContainerTimestamps(r *types.ContainerJSON) (time.Time, time.Time, time.
return createdAt, startedAt, finishedAt, err
}
return createdAt, startedAt, finishedAt, nil
}
}
4 changes: 2 additions & 2 deletions core/container_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ package core
import (
"context"
"fmt"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"

v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// StartContainer starts the container.
Expand Down Expand Up @@ -58,4 +59,3 @@ func transformStartContainerError(err error) error {
}
return err
}

4 changes: 2 additions & 2 deletions core/container_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package core
import (
"context"
"fmt"

"github.com/Mirantis/cri-dockerd/libdocker"
"github.com/sirupsen/logrus"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ContainerStatus inspects the docker container and returns the status.
Expand Down Expand Up @@ -138,4 +139,3 @@ func (ds *dockerService) ContainerStatus(
}
return &v1.ContainerStatusResponse{Status: status}, nil
}

4 changes: 2 additions & 2 deletions core/container_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ package core

import (
"context"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"time"

v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// StopContainer stops a running container with a grace period (i.e., timeout).
Expand All @@ -33,4 +34,3 @@ func (ds *dockerService) StopContainer(
}
return &v1.StopContainerResponse{}, nil
}

2 changes: 1 addition & 1 deletion core/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
containertest "k8s.io/kubernetes/pkg/kubelet/container/testing"
)

Expand Down
4 changes: 2 additions & 2 deletions core/container_update_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package core
import (
"context"
"fmt"

"github.com/docker/docker/api/types/container"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func (ds *dockerService) UpdateContainerResources(
Expand All @@ -45,4 +46,3 @@ func (ds *dockerService) UpdateContainerResources(
}
return &v1.UpdateContainerResourcesResponse{}, nil
}

2 changes: 1 addition & 1 deletion core/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
dockercontainer "github.com/docker/docker/api/types/container"
dockerimagetypes "github.com/docker/docker/api/types/image"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"

digest "github.com/opencontainers/go-digest"
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion core/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
dockertypes "github.com/docker/docker/api/types"
"github.com/stretchr/testify/assert"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestConvertDockerStatusToRuntimeAPIState(t *testing.T) {
Expand Down
17 changes: 16 additions & 1 deletion core/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/sirupsen/logrus"

v1 "k8s.io/api/core/v1"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

const (
Expand Down Expand Up @@ -452,3 +452,18 @@ func (ds *dockerService) getDockerVersionFromCache() (*dockertypes.Version, erro
}
return dv, nil
}

func (ds *dockerService) CheckpointContainer(ctx context.Context, options *runtimeapi.CheckpointContainerRequest) (*runtimeapi.CheckpointContainerResponse, error) {
return nil, nil
}
func (ds *dockerService) GetContainerEvents(eventReq *runtimeapi.GetEventsRequest, containerEventServer runtimeapi.RuntimeService_GetContainerEventsServer) error {
return nil
}

func (ds *dockerService) ListMetricDescriptors(ctx context.Context, s *runtimeapi.ListMetricDescriptorsRequest) (*runtimeapi.ListMetricDescriptorsResponse, error) {
return nil, nil
}

func (ds *dockerService) ListPodSandboxMetrics(ctx context.Context, s *runtimeapi.ListPodSandboxMetricsRequest) (*runtimeapi.ListPodSandboxMetricsResponse, error) {
return nil, nil
}
2 changes: 1 addition & 1 deletion core/docker_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
containertest "k8s.io/kubernetes/pkg/kubelet/container/testing"
clock "k8s.io/utils/clock/testing"

Expand Down
4 changes: 3 additions & 1 deletion core/helpers_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand All @@ -20,11 +21,12 @@ package core

import (
"fmt"

"github.com/blang/semver"
dockertypes "github.com/docker/docker/api/types"
dockercontainer "github.com/docker/docker/api/types/container"
"github.com/sirupsen/logrus"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// DefaultMemorySwap always returns 0 for no memory swap in a sandbox
Expand Down
2 changes: 1 addition & 1 deletion core/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestLabelsAndAnnotationsRoundTrip(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion core/helpers_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows

/*
Expand All @@ -24,7 +25,7 @@ import (
"github.com/blang/semver"
dockertypes "github.com/docker/docker/api/types"
"github.com/sirupsen/logrus"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// DefaultMemorySwap always returns -1 for no memory swap in a sandbox
Expand Down
5 changes: 3 additions & 2 deletions core/helpers_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down Expand Up @@ -28,11 +29,11 @@ import (
"runtime"

"github.com/blang/semver"
"github.com/sirupsen/logrus"
dockertypes "github.com/docker/docker/api/types"
dockercontainer "github.com/docker/docker/api/types/container"
dockerfilters "github.com/docker/docker/api/types/filters"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"github.com/sirupsen/logrus"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// DefaultMemorySwap always returns 0 for no memory swap in a sandbox
Expand Down
2 changes: 1 addition & 1 deletion core/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/docker/docker/pkg/jsonmessage"

"github.com/sirupsen/logrus"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/Mirantis/cri-dockerd/libdocker"
)
Expand Down
3 changes: 2 additions & 1 deletion core/image_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

/*
Expand Down Expand Up @@ -26,7 +27,7 @@ import (

"github.com/sirupsen/logrus"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ImageFsInfo returns information of the filesystem that is used to store images.
Expand Down
2 changes: 1 addition & 1 deletion core/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/Mirantis/cri-dockerd/libdocker"
)
Expand Down
3 changes: 2 additions & 1 deletion core/image_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows

/*
Expand All @@ -22,7 +23,7 @@ import (
"context"
"fmt"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ImageFsInfo returns information of the filesystem that is used to store images.
Expand Down
3 changes: 2 additions & 1 deletion core/image_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand All @@ -24,7 +25,7 @@ import (

"github.com/sirupsen/logrus"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/kubernetes/pkg/kubelet/winstats"
)

Expand Down
2 changes: 1 addition & 1 deletion core/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubetypes "k8s.io/apimachinery/pkg/types"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"

"github.com/Mirantis/cri-dockerd/libdocker"
)
Expand Down
2 changes: 1 addition & 1 deletion core/naming.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/Mirantis/cri-dockerd/config"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Container "names" are implementation details that do not concern
Expand Down
2 changes: 1 addition & 1 deletion core/naming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/stretchr/testify/assert"

runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
)

func TestSandboxNameRoundTrip(t *testing.T) {
Expand Down
Loading

0 comments on commit 7abf2e5

Please sign in to comment.