Skip to content

Commit 311f929

Browse files
authored
Merge pull request #103 from jsafrane/deprecate-snapshotter
Deprecate --snapshotter option
2 parents 29fe5ab + bf768d8 commit 311f929

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cmd/csi-snapshotter/main.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const (
5050

5151
// Command line flags
5252
var (
53-
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.")
53+
snapshotter = flag.String("snapshotter", "", "This option is deprecated.")
5454
kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
5555
connectionTimeout = flag.Duration("connection-timeout", 0, "The --connection-timeout flag is deprecated")
5656
csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
@@ -79,6 +79,9 @@ func main() {
7979
if *connectionTimeout != 0 {
8080
glog.Warning("--connection-timeout is deprecated and will have no effect")
8181
}
82+
if *snapshotter != "" {
83+
glog.Warning("--snapshotter is deprecated and will have no effect")
84+
}
8285

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

133136
// Find driver name
134-
if *snapshotter == "" {
135-
*snapshotter, err = csiConn.GetDriverName(ctx)
136-
if err != nil {
137-
glog.Error(err.Error())
138-
os.Exit(1)
139-
}
137+
*snapshotter, err = csiConn.GetDriverName(ctx)
138+
if err != nil {
139+
glog.Error(err.Error())
140+
os.Exit(1)
140141
}
141142
glog.V(2).Infof("CSI driver name: %q", *snapshotter)
142143

0 commit comments

Comments
 (0)