Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func main() {
klog.Warning("--snapshotter is deprecated and will have no effect")
}

if len(*snapshotNamePrefix) == 0 {
klog.Error("Snapshot name prefix cannot be of length 0")
os.Exit(1)
}
// Create the client config. Use kubeconfig if given, otherwise assume in-cluster.
config, err := buildConfig(*kubeconfig)
if err != nil {
Expand Down Expand Up @@ -173,11 +177,6 @@ func main() {
os.Exit(1)
}

if len(*snapshotNamePrefix) == 0 {
klog.Error("Snapshot name prefix cannot be of length 0")
os.Exit(1)
}

klog.V(2).Infof("Start NewCSISnapshotController with snapshotter [%s] kubeconfig [%s] csiTimeout [%+v] csiAddress [%s] createSnapshotContentRetryCount [%d] createSnapshotContentInterval [%+v] resyncPeriod [%+v] snapshotNamePrefix [%s] snapshotNameUUIDLength [%d]", *snapshotterName, *kubeconfig, *csiTimeout, *csiAddress, createSnapshotContentRetryCount, *createSnapshotContentInterval, *resyncPeriod, *snapshotNamePrefix, snapshotNameUUIDLength)

snapShotter := snapshotter.NewSnapshotter(csiConn)
Expand Down