external-snapshotter should use CSI connection lib

This commit is contained in:
Andrew Kim
2019-02-13 22:42:05 -05:00
parent 7536845501
commit 0da03b3210
3 changed files with 10 additions and 42 deletions

View File

@@ -52,7 +52,7 @@ const (
var (
snapshotter = flag.String("snapshotter", "", "Name of the snapshotter. The snapshotter will only create snapshot content for snapshot that requests a VolumeSnapshotClass with a snapshotter field set equal to this name.")
kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
connectionTimeout = flag.Duration("connection-timeout", 1*time.Minute, "Timeout for waiting for CSI driver socket.")
connectionTimeout = flag.Duration("connection-timeout", 0, "The --connection-timeout flag is deprecated")
csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
createSnapshotContentRetryCount = flag.Int("create-snapshotcontent-retrycount", 5, "Number of retries when we create a snapshot content object for a snapshot.")
createSnapshotContentInterval = flag.Duration("create-snapshotcontent-interval", 10*time.Second, "Interval between retries when we create a snapshot content object for a snapshot.")
@@ -76,6 +76,10 @@ func main() {
}
glog.Infof("Version: %s", version)
if *connectionTimeout != 0 {
glog.Warning("--connection-timeout is deprecated and will have no effect")
}
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
config, err := buildConfig(*kubeconfig)
if err != nil {
@@ -116,7 +120,7 @@ func main() {
snapshotscheme.AddToScheme(scheme.Scheme)
// Connect to CSI.
csiConn, err := connection.New(*csiAddress, *connectionTimeout)
csiConn, err := connection.New(*csiAddress)
if err != nil {
glog.Error(err.Error())
os.Exit(1)