You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
snapshotterName=flag.String("snapshotter", "", "This option is deprecated.")
60
-
kubeconfig=flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
61
-
connectionTimeout=flag.Duration("connection-timeout", 0, "The --connection-timeout flag is deprecated")
62
-
csiAddress=flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
63
-
createSnapshotContentRetryCount=flag.Int("create-snapshotcontent-retrycount", 5, "Number of retries when we create a snapshot content object for a snapshot.")
64
-
createSnapshotContentInterval=flag.Duration("create-snapshotcontent-interval", 10*time.Second, "Interval between retries when we create a snapshot content object for a snapshot.")
65
-
resyncPeriod=flag.Duration("resync-period", 60*time.Second, "Resync interval of the controller.")
66
-
snapshotNamePrefix=flag.String("snapshot-name-prefix", "snapshot", "Prefix to apply to the name of a created snapshot")
67
-
snapshotNameUUIDLength=flag.Int("snapshot-name-uuid-length", -1, "Length in characters for the generated uuid of a created snapshot. Defaults behavior is to NOT truncate.")
csiTimeout=flag.Duration("timeout", defaultCSITimeout, "The timeout for any RPCs to the CSI driver. Default is 1 minute.")
59
+
kubeconfig=flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
60
+
csiAddress=flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
61
+
resyncPeriod=flag.Duration("resync-period", 60*time.Second, "Resync interval of the controller.")
62
+
snapshotNamePrefix=flag.String("snapshot-name-prefix", "snapshot", "Prefix to apply to the name of a created snapshot")
63
+
snapshotNameUUIDLength=flag.Int("snapshot-name-uuid-length", -1, "Length in characters for the generated uuid of a created snapshot. Defaults behavior is to NOT truncate.")
leaderElectionNamespace=flag.String("leader-election-namespace", "", "The namespace where the leader election resource exists. Defaults to the pod namespace if not set.")
@@ -88,14 +84,6 @@ func main() {
88
84
}
89
85
klog.Infof("Version: %s", version)
90
86
91
-
if*connectionTimeout!=0 {
92
-
klog.Warning("--connection-timeout is deprecated and will have no effect")
93
-
}
94
-
95
-
if*snapshotterName!="" {
96
-
klog.Warning("--snapshotter is deprecated and will have no effect")
97
-
}
98
-
99
87
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
kubeconfig=flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
50
+
createSnapshotContentRetryCount=flag.Int("create-snapshotcontent-retrycount", 5, "Number of retries when we create a snapshot content object for a snapshot.")
51
+
createSnapshotContentInterval=flag.Duration("create-snapshotcontent-interval", 10*time.Second, "Interval between retries when we create a snapshot content object for a snapshot.")
52
+
resyncPeriod=flag.Duration("resync-period", 60*time.Second, "Resync interval of the controller.")
leaderElectionNamespace=flag.String("leader-election-namespace", "", "The namespace where the leader election resource exists. Defaults to the pod namespace if not set.")
57
+
)
58
+
59
+
var (
60
+
version="unknown"
61
+
)
62
+
63
+
funcmain() {
64
+
klog.InitFlags(nil)
65
+
flag.Set("logtostderr", "true")
66
+
flag.Parse()
67
+
68
+
if*showVersion {
69
+
fmt.Println(os.Args[0], version)
70
+
os.Exit(0)
71
+
}
72
+
klog.Infof("Version: %s", version)
73
+
74
+
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
75
+
config, err:=buildConfig(*kubeconfig)
76
+
iferr!=nil {
77
+
klog.Error(err.Error())
78
+
os.Exit(1)
79
+
}
80
+
81
+
kubeClient, err:=kubernetes.NewForConfig(config)
82
+
iferr!=nil {
83
+
klog.Error(err.Error())
84
+
os.Exit(1)
85
+
}
86
+
87
+
snapClient, err:=clientset.NewForConfig(config)
88
+
iferr!=nil {
89
+
klog.Errorf("Error building snapshot clientset: %s", err.Error())
0 commit comments