Skip to content

Instantly share code, notes, and snippets.

@cofyc
Created October 28, 2019 02:19
Show Gist options
  • Save cofyc/10d881fd2a508433303a4a556a525c92 to your computer and use it in GitHub Desktop.
Save cofyc/10d881fd2a508433303a4a556a525c92 to your computer and use it in GitHub Desktop.
kubernetes volume plugins
package main
import (
"fmt"
"k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/pkg/volume"
)
func main() {
plugins := app.ProbeVolumePlugins()
for _, plugin := range plugins {
if _, ok := plugin.(volume.AttachableVolumePlugin); ok {
fmt.Printf("%q implements AttachableVolumePlugin\n", plugin.GetPluginName())
} else {
if _, ok := plugin.(volume.DeviceMountableVolumePlugin); ok {
fmt.Printf("%q does not implement AttachableVolumePlugin but implements DeviceMountableVolumePlugin\n", plugin.GetPluginName())
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment