-
Notifications
You must be signed in to change notification settings - Fork 159
Use CSI proxy v1 client library #738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
kind: DaemonSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-gce-pd-node | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: gce-pd-driver | ||
imagePullPolicy: Always | ||
--- | ||
kind: DaemonSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: csi-gce-pd-node-win | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: gce-pd-driver | ||
imagePullPolicy: Always |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
# replace the following with annotation approach. https://github.com/docker/cli/pull/2578 | ||
|
||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
_WINDOWS_VERSIONS="20H2 2004 1909 ltsc2019" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line was unused in this program |
||
BASE="mcr.microsoft.com/windows/servercore" | ||
|
||
IFS=', ' read -r -a imagetags <<< "$WINDOWS_IMAGE_TAGS" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ func formatAndMount(source, target, fstype string, options []string, m *mount.Sa | |
if !strings.EqualFold(fstype, defaultWindowsFsType) { | ||
return fmt.Errorf("GCE PD CSI driver can only supports %s file system, it does not support %s", defaultWindowsFsType, fstype) | ||
} | ||
proxy, ok := m.Interface.(*mounter.CSIProxyMounter) | ||
proxy, ok := m.Interface.(mounter.CSIProxyMounter) | ||
if !ok { | ||
return fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
|
@@ -39,7 +39,7 @@ func formatAndMount(source, target, fstype string, options []string, m *mount.Sa | |
// not exist. Currently kubelet creates the path beforehand, this is a workaround to | ||
// remove the path first. | ||
func preparePublishPath(path string, m *mount.SafeFormatAndMount) error { | ||
proxy, ok := m.Interface.(*mounter.CSIProxyMounter) | ||
proxy, ok := m.Interface.(mounter.CSIProxyMounter) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why pointer is removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously it was a struct, now it's an interface implemented by v1 and v1beta |
||
if !ok { | ||
return fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
|
@@ -60,15 +60,15 @@ func prepareStagePath(path string, m *mount.SafeFormatAndMount) error { | |
} | ||
|
||
func cleanupPublishPath(path string, m *mount.SafeFormatAndMount) error { | ||
proxy, ok := m.Interface.(*mounter.CSIProxyMounter) | ||
proxy, ok := m.Interface.(mounter.CSIProxyMounter) | ||
if !ok { | ||
return fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
return proxy.RemovePodDir(path) | ||
} | ||
|
||
func cleanupStagePath(path string, m *mount.SafeFormatAndMount) error { | ||
proxy, ok := m.Interface.(*mounter.CSIProxyMounter) | ||
proxy, ok := m.Interface.(mounter.CSIProxyMounter) | ||
if !ok { | ||
return fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
|
@@ -85,18 +85,18 @@ func getDevicePath(ns *GCENodeServer, volumeID, partition string) (string, error | |
if err != nil { | ||
return "", fmt.Errorf("error getting device name: %v", err) | ||
} | ||
proxy, ok := ns.Mounter.Interface.(*mounter.CSIProxyMounter) | ||
|
||
proxy, ok := ns.Mounter.Interface.(mounter.CSIProxyMounter) | ||
if !ok { | ||
return "", fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
return proxy.GetDevicePath(deviceName, partition, volumeKey.Name) | ||
return proxy.GetDiskNumber(deviceName, partition, volumeKey.Name) | ||
} | ||
|
||
func getBlockSizeBytes(devicePath string, m *mount.SafeFormatAndMount) (int64, error) { | ||
proxy, ok := m.Interface.(*mounter.CSIProxyMounter) | ||
proxy, ok := m.Interface.(mounter.CSIProxyMounter) | ||
if !ok { | ||
return 0, fmt.Errorf("could not cast to csi proxy class") | ||
} | ||
|
||
return proxy.GetBlockSizeBytes(devicePath) | ||
return proxy.GetDiskTotalBytes(devicePath) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need add this yaml too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a dev only file, I used it to deploy the GCE PD CSI driver with
AlwaysPull