Skip to content

Commit

Permalink
Merge pull request #103 from jsafrane/deprecate-snapshotter
Browse files Browse the repository at this point in the history
Deprecate --snapshotter option
  • Loading branch information
k8s-ci-robot authored Mar 14, 2019
2 parents 29fe5ab + bf768d8 commit 311f929
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const (

// Command line flags
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.")
snapshotter = flag.String("snapshotter", "", "This option is deprecated.")
kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
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.")
Expand Down Expand Up @@ -79,6 +79,9 @@ func main() {
if *connectionTimeout != 0 {
glog.Warning("--connection-timeout is deprecated and will have no effect")
}
if *snapshotter != "" {
glog.Warning("--snapshotter is deprecated and will have no effect")
}

// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
config, err := buildConfig(*kubeconfig)
Expand Down Expand Up @@ -131,12 +134,10 @@ func main() {
defer cancel()

// Find driver name
if *snapshotter == "" {
*snapshotter, err = csiConn.GetDriverName(ctx)
if err != nil {
glog.Error(err.Error())
os.Exit(1)
}
*snapshotter, err = csiConn.GetDriverName(ctx)
if err != nil {
glog.Error(err.Error())
os.Exit(1)
}
glog.V(2).Infof("CSI driver name: %q", *snapshotter)

Expand Down

0 comments on commit 311f929

Please sign in to comment.