Skip to content

Commit

Permalink
Keep using v1beta1 for the volume API
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciopoppe committed Jun 11, 2021
1 parent 666f2b9 commit d623c9f
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 2,195 deletions.
24 changes: 12 additions & 12 deletions deploy/kubernetes/base/node_windows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ spec:
mountPropagation: "None"
- name: plugin-dir
mountPath: C:\csi
- name: csi-proxy-volume-v1
mountPath: \\.\pipe\csi-proxy-volume-v1
- name: csi-proxy-filesystem-v1
mountPath: \\.\pipe\csi-proxy-filesystem-v1
- name: csi-proxy-disk-v1
mountPath: \\.\pipe\csi-proxy-disk-v1
- name: csi-proxy-volume-v1beta3
mountPath: \\.\pipe\csi-proxy-volume-v1beta3
- name: csi-proxy-filesystem-v1beta2
mountPath: \\.\pipe\csi-proxy-filesystem-v1beta2
- name: csi-proxy-disk-v1beta3
mountPath: \\.\pipe\csi-proxy-disk-v1beta3
# these paths are still included for compatibility, they're used
# only if the node has still the beta version of the CSI proxy
- name: csi-proxy-volume-v1beta1
Expand All @@ -68,17 +68,17 @@ spec:
- name: csi-proxy-disk-v1beta2
mountPath: \\.\pipe\csi-proxy-disk-v1beta2
volumes:
- name: csi-proxy-disk-v1
- name: csi-proxy-disk-v1beta3
hostPath:
path: \\.\pipe\csi-proxy-disk-v1
path: \\.\pipe\csi-proxy-disk-v1beta3
type: ""
- name: csi-proxy-volume-v1
- name: csi-proxy-volume-v1beta3
hostPath:
path: \\.\pipe\csi-proxy-volume-v1
path: \\.\pipe\csi-proxy-volume-v1beta3
type: ""
- name: csi-proxy-filesystem-v1
- name: csi-proxy-filesystem-v1beta2
hostPath:
path: \\.\pipe\csi-proxy-filesystem-v1
path: \\.\pipe\csi-proxy-filesystem-v1beta2
type: ""
- name: csi-proxy-disk-v1beta2
hostPath:
Expand Down
4 changes: 2 additions & 2 deletions pkg/mount-manager/safe-mounter-v1beta_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
fsapi "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1"
fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1"

volumeapi "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2"
volumeclient "github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2"
volumeapi "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1"
volumeclient "github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1"

"k8s.io/klog"
mount "k8s.io/mount-utils"
Expand Down
6 changes: 3 additions & 3 deletions pkg/mount-manager/statter_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"context"
"fmt"

volumeapiv1beta2 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2"
volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1"
// TODO(mauriciopoppe): use v1 when it's released, the import is aliased to volumeapiv1 for a smaller diff later
volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta3"
"k8s.io/mount-utils"
Expand Down Expand Up @@ -83,7 +83,7 @@ func (r *realStatter) StatFSV1Beta(path string) (available, capacity, used, inod

proxy := r.mounter.Interface.(*CSIProxyMounterV1Beta)

idRequest := &volumeapiv1beta2.VolumeIDFromMountRequest{
idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{
Mount: path,
}
idResponse, err := proxy.VolumeClient.GetVolumeIDFromMount(context.Background(), idRequest)
Expand All @@ -92,7 +92,7 @@ func (r *realStatter) StatFSV1Beta(path string) (available, capacity, used, inod
}
volumeID := idResponse.GetVolumeId()

request := &volumeapiv1beta2.VolumeStatsRequest{
request := &volumeapiv1beta1.VolumeStatsRequest{
VolumeId: volumeID,
}
response, err := proxy.VolumeClient.VolumeStats(context.Background(), request)
Expand Down
6 changes: 3 additions & 3 deletions pkg/resizefs/resizefs_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"context"
"fmt"

volumeapiv1beta2 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2"
volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1"
// TODO(mauriciopoppe): use v1 when it's released, the import is aliased to volumeapiv1 for a smaller diff later
volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta3"

Expand Down Expand Up @@ -84,7 +84,7 @@ func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string

proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1Beta)

idRequest := &volumeapiv1beta2.VolumeIDFromMountRequest{
idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{
Mount: deviceMountPath,
}
idResponse, err := proxy.VolumeClient.GetVolumeIDFromMount(context.Background(), idRequest)
Expand All @@ -93,7 +93,7 @@ func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string
}
volumeId := idResponse.GetVolumeId()

request := &volumeapiv1beta2.ResizeVolumeRequest{
request := &volumeapiv1beta1.ResizeVolumeRequest{
VolumeId: volumeId,
}
_, err = proxy.VolumeClient.ResizeVolume(context.Background(), request)
Expand Down
Loading

0 comments on commit d623c9f

Please sign in to comment.