Skip to content

Commit

Permalink
Use CRI v1 instead of v1alpha2 (#97)
Browse files Browse the repository at this point in the history
* Fix imports
* Update README with compatibility matrix
  • Loading branch information
mugdha-adhav authored Jan 2, 2024
1 parent 9609938 commit 568db36
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 12 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ then mounts images via the snapshot/storage service of the runtime.
* [Pre-provisioned PV](#pre-provisioned-pv)
* [Private Image](#private-image)

## Compatibility matrix
Tested changes on below mentioned versions -

| warm-metal | k8s version | containerd | crio |
|------------|-------------|------------|---------|
| 0.6.x | v1.25 | 1.6.8 | v1.20.9 |
| 0.7.x | v1.25 | 1.6.8 | v1.20.9 |
| 0.8.x | v1.25 | 1.6.8 | v1.20.9 |
| 1.0.x | v1.25 | 1.6.8 | v1.25.2 |

#### References:
* containerd [releases](https://containerd.io/releases/#kubernetes-support)
* cri-o [releases](https://github.com/cri-o/cri-o/releases)

## Installation

The driver requires to mount various host paths for different container runtimes.
Expand Down
2 changes: 1 addition & 1 deletion cmd/install/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/BurntSushi/toml"
"google.golang.org/grpc"
corev1 "k8s.io/api/core/v1"
criapis "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
criapis "k8s.io/cri-api/pkg/apis/runtime/v1"
)

var typeDir = corev1.HostPathDirectory
Expand Down
2 changes: 1 addition & 1 deletion cmd/plugin/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
csicommon "github.com/warm-metal/csi-drivers/pkg/csi-common"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
cri "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
cri "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/klog/v2"
k8smount "k8s.io/mount-utils"
)
Expand Down
5 changes: 2 additions & 3 deletions cmd/plugin/node_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"time"

"github.com/container-storage-interface/spec/lib/go/csi"
csipbv1 "github.com/container-storage-interface/spec/lib/go/csi"
"github.com/stretchr/testify/assert"
"github.com/warm-metal/csi-driver-image/pkg/backend"
"github.com/warm-metal/csi-driver-image/pkg/backend/containerd"
Expand Down Expand Up @@ -116,7 +115,7 @@ func TestNodePublishVolumeAsync(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, conn)

nodeClient := csipbv1.NewNodeClient(conn)
nodeClient := csi.NewNodeClient(conn)
assert.NotNil(t, nodeClient)

condFn := func() (done bool, err error) {
Expand Down Expand Up @@ -239,7 +238,7 @@ func TestNodePublishVolumeSync(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, conn)

nodeClient := csipbv1.NewNodeClient(conn)
nodeClient := csi.NewNodeClient(conn)
assert.NotNil(t, nodeClient)

condFn := func() (done bool, err error) {
Expand Down
2 changes: 1 addition & 1 deletion hack/integration-test-image/kind-node-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM docker.io/warmmetal/kindest-node-crio:v1.25.2
FROM docker.io/warmmetal/kindest-node-crio:v1.25.2-updated
COPY crio.conf /etc/crio/crio.conf
2 changes: 1 addition & 1 deletion pkg/cri/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"google.golang.org/grpc"
cri "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
cri "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/kubelet/util"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pullexecutor/pullexecutor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/warm-metal/csi-driver-image/pkg/remoteimage"
"github.com/warm-metal/csi-driver-image/pkg/secret"
"k8s.io/apimachinery/pkg/util/wait"
cri "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
cri "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/klog/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/remoteimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/containerd/containerd/reference/docker"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
cri "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
cri "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/kubernetes/pkg/credentialprovider"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/remoteimage/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/warm-metal/csi-driver-image/pkg/cri"
"k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
v1 "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// Check test/integration/node-server/README.md for how to run this test correctly
Expand All @@ -20,8 +20,8 @@ func TestPull(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, criClient)

r, err := criClient.PullImage(context.Background(), &v1alpha2.PullImageRequest{
Image: &v1alpha2.ImageSpec{
r, err := criClient.PullImage(context.Background(), &v1.PullImageRequest{
Image: &v1.ImageSpec{
Image: testImage,
},
})
Expand Down

0 comments on commit 568db36

Please sign in to comment.