Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
apply workaround for kubernetes/kubernetes#44737
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayley Swimelar committed May 22, 2017
1 parent f59e748 commit c64e780
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ this may be overridden via the kubelet `--hostname-override` parameter
`example.yaml`, located in the root of this project, contains an example
configuration that attaches a resource named `r0` to the container under the path
`/data`

Please note that the physical volume name and the resource name associated
**must** match in order for the volume to be detached from the kublet due to
https://github.com/kubernetes/kubernetes/issues/44737
4 changes: 2 additions & 2 deletions example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ spec:
command: [/bin/bash]
args: ["-c", "while true; do sleep 10; done"]
volumeMounts:
- name: test
- name: r0
mountPath: /data
ports:
- containerPort: 80
volumes:
- name: test
- name: r0
flexVolume:
driver: "linbit/drbd"
fsType: "ext4"
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (api FlexVolumeApi) Call(s []string) (string, int) {
if len(s) < 1 {
res, _ := json.Marshal(response{
Status: "Failure",
Message: "No driver action! Valid actions are: init, attach, detach, mountdevice, unmountdevice, getvolumename, isattached",
Message: "No driver action! Valid actions are: init, attach, detach, mountdevice, unmountdevice, isattached",
})
return string(res), EXITBADAPICALL
}
Expand All @@ -102,8 +102,6 @@ func (api FlexVolumeApi) Call(s []string) (string, int) {
return api.unmountDevice(s)
case "unmount":
return api.unmount(s)
case "getvolumename":
return api.getVolumeName(s)
case "isattached":
return api.isAttached(s)
default:
Expand Down

0 comments on commit c64e780

Please sign in to comment.