Skip to content
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

csi: fix incosistent driver name usages #100

Merged
merged 1 commit into from Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
## unreleased

* Fix inconsistent usage of the driver name
[[GH-100]](https://github.com/digitalocean/csi-digitalocean/pull/100)
* Use publish_info in ControllerPublishVolume for storing and accessing the
volume name on Node plugins. This allows us to do all Node related operations
without relying on the DO API.
Expand Down
2 changes: 1 addition & 1 deletion cmd/do-csi-plugin/main.go
Expand Up @@ -27,7 +27,7 @@ import (

func main() {
var (
endpoint = flag.String("endpoint", "unix:///var/lib/kubelet/plugins/com.digitalocean.csi.dobs/csi.sock", "CSI endpoint")
endpoint = flag.String("endpoint", "unix:///var/lib/kubelet/plugins/"+driver.DriverName+"/csi.sock", "CSI endpoint")
token = flag.String("token", "", "DigitalOcean access token")
url = flag.String("url", "https://api.digitalocean.com/", "DigitalOcean API URL")
version = flag.Bool("version", false, "Print the version and exit.")
Expand Down
7 changes: 6 additions & 1 deletion driver/controller.go
Expand Up @@ -41,10 +41,15 @@ const (
)

const (
PublishInfoVolumeName = "com.digitalocean.csi/volume-name"
// PublishInfoVolumeName is used to pass the volume name from
// `ControllerPublishVolume` to `NodeStageVolume or `NodePublishVolume`
PublishInfoVolumeName = DriverName + "/volume-name"

// defaultVolumeSizeInGB is used when the user didn't defined a correct
// storage size or if the size is not satisfised
defaultVolumeSizeInGB = 16 * GB

// createdByDO is used to tag volumes that are created by this CSI plugin
createdByDO = "Created by DigitalOcean CSI driver"
)

Expand Down
4 changes: 3 additions & 1 deletion driver/driver.go
Expand Up @@ -36,7 +36,9 @@ import (
)

const (
driverName = "dobs.csi.digitalocean.com"
// DriverName defines the name that is used in Kubernetes and the CSI
// system for the canonical, official name of this plugin
DriverName = "dobs.csi.digitalocean.com"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion driver/identity.go
Expand Up @@ -27,7 +27,7 @@ import (
// GetPluginInfo returns metadata of the plugin
func (d *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
resp := &csi.GetPluginInfoResponse{
Name: driverName,
Name: DriverName,
VendorVersion: version,
}

Expand Down
2 changes: 1 addition & 1 deletion driver/node.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/kubernetes/pod-single-existing-volume/README.md
Expand Up @@ -27,7 +27,7 @@ metadata:
annotations:
# fake it by indicating this is provisioned dynamically, so the system
# works properly
pv.kubernetes.io/provisioned-by: com.digitalocean.csi.dobs
pv.kubernetes.io/provisioned-by: dobs.csi.digitalocean.com
spec:
storageClassName: do-block-storage
# by default, the volume will be not deleted if you delete the PVC, change to
Expand All @@ -38,7 +38,7 @@ spec:
accessModes:
- ReadWriteOnce
csi:
driver: com.digitalocean.csi.dobs
driver: dobs.csi.digitalocean.com
fsType: ext4
volumeHandle: 1952d58a-c714-11e8-bc0c-0a58ac14421e
volumeAttributes:
Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes/pod-single-existing-volume/pv.yaml
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
# fake it by indicating this is provisioned dynamically, so the system
# works properly
pv.kubernetes.io/provisioned-by: com.digitalocean.csi.dobs
pv.kubernetes.io/provisioned-by: dobs.csi.digitalocean.com
spec:
storageClassName: do-block-storage
# by default, the volume will be not deleted if you delete the PVC, change to
Expand All @@ -16,7 +16,7 @@ spec:
accessModes:
- ReadWriteOnce
csi:
driver: com.digitalocean.csi.dobs
driver: dobs.csi.digitalocean.com
fsType: ext4
volumeHandle: 1952d58a-c714-11e8-bc0c-0a58ac14421e
volumeAttributes:
Expand Down