diff --git a/deploy/kubernetes-1.17/test-driver.yaml b/deploy/kubernetes-1.17/test-driver.yaml index 20f5da371..7133f20dc 100644 --- a/deploy/kubernetes-1.17/test-driver.yaml +++ b/deploy/kubernetes-1.17/test-driver.yaml @@ -8,6 +8,8 @@ SnapshotClass: FromName: true DriverInfo: Name: hostpath.csi.k8s.io + SupportedSizeRange: + Min: 1Mi Capabilities: block: true controllerExpansion: true diff --git a/docs/example-snapshots-1.17-and-later.md b/docs/example-snapshots-1.17-and-later.md index d0d0b97a6..c3c055c5b 100644 --- a/docs/example-snapshots-1.17-and-later.md +++ b/docs/example-snapshots-1.17-and-later.md @@ -18,7 +18,7 @@ Ensure your volumesnapshotclass was created during hostpath deployment: > $ kubectl describe volumesnapshotclass > ``` > Name: csi-hostpath-snapclass -> Namespace: +> Namespace: > Labels: > Annotations: kubectl.kubernetes.io/last-applied-configuration: > {"apiVersion":"snapshot.storage.k8s.io/v1beta1","deletionPolicy":"Delete","driver":"hostpath.csi.k8s.io","kind":"VolumeSnapshotClass","met... @@ -89,7 +89,7 @@ use the volume snapshot class to dynamically create a volume snapshot: > $ kubectl describe volumesnapshotcontent > ``` > Name: snapcontent-1b461d4e-6279-4f1d-9910-61d35d80c888 -> Namespace: +> Namespace: > Labels: > Annotations: > API Version: snapshot.storage.k8s.io/v1beta1 @@ -126,6 +126,7 @@ use the volume snapshot class to dynamically create a volume snapshot: ## Restore volume from snapshot support Follow the following example to create a volume from a volume snapshot: +Note that as the PVC size goes larger, the restore can be slower. > $ kubectl apply -f examples/csi-restore.yaml > `persistentvolumeclaim/hpvc-restore created` diff --git a/pkg/hostpath/controllerserver.go b/pkg/hostpath/controllerserver.go index bdc41df71..fea8f4863 100644 --- a/pkg/hostpath/controllerserver.go +++ b/pkg/hostpath/controllerserver.go @@ -187,6 +187,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol err = status.Errorf(codes.InvalidArgument, "%v not a proper volume source", volumeSource) } if err != nil { + glog.V(4).Infof("VolumeSource error: %v", err) if delErr := deleteHostpathVolume(volumeID); delErr != nil { glog.V(2).Infof("deleting hostpath volume %v failed: %v", volumeID, delErr) } diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go index d01e88516..0cab83799 100644 --- a/pkg/hostpath/hostpath.go +++ b/pkg/hostpath/hostpath.go @@ -344,7 +344,9 @@ func loadFromSnapshot(size int64, snapshotId, destPath string, mode accessType) } executor := utilexec.New() + glog.V(4).Infof("Command Start: %v", cmd) out, err := executor.Command(cmd[0], cmd[1:]...).CombinedOutput() + glog.V(4).Infof("Command Finish: %v", string(out)) if err != nil { return status.Errorf(codes.Internal, "failed pre-populate data from snapshot %v: %v: %s", snapshotId, err, out) } diff --git a/pkg/hostpath/server.go b/pkg/hostpath/server.go index 157015482..882f80b1a 100644 --- a/pkg/hostpath/server.go +++ b/pkg/hostpath/server.go @@ -114,6 +114,9 @@ func parseEndpoint(ep string) (string, string, error) { } func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + if info.FullMethod == "/csi.v1.Identity/Probe" { + return handler(ctx, req) + } glog.V(3).Infof("GRPC call: %s", info.FullMethod) glog.V(5).Infof("GRPC request: %+v", protosanitizer.StripSecrets(req)) resp, err := handler(ctx, req)