Skip to content

Commit 08f2086

Browse files
committed
fix: Cleanup some warnings
1 parent b1536df commit 08f2086

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

pkg/rclone/nodeserver.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ import (
3939
csicommon "github.com/kubernetes-csi/drivers/pkg/csi-common"
4040
)
4141

42-
const CSI_ANNOTATION_PREFIX = "csi-rclone.dev"
43-
const pvcSecretNameAnnotation = CSI_ANNOTATION_PREFIX + "/secretName"
44-
4542
type NodeServer struct {
4643
*csicommon.DefaultNodeServer
4744
mounter *mount.SafeFormatAndMount
@@ -134,7 +131,7 @@ func NewNodeServer(csiDriver *csicommon.CSIDriver, cacheDir string, cacheSize st
134131
return ns, nil
135132
}
136133

137-
func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
134+
func (ns *NodeServer) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
138135
return &csi.NodeGetCapabilitiesResponse{
139136
Capabilities: []*csi.NodeServiceCapability{
140137
{
@@ -413,7 +410,7 @@ func validateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error {
413410
}
414411
}
415412

416-
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
413+
func (ns *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
417414
if err := validateNodePublishVolumeRequest(req); err != nil {
418415
return nil, err
419416
}
@@ -482,7 +479,7 @@ func extractFlags(volumeContext map[string]string, secret map[string]string, pvc
482479
if len(secret) > 0 {
483480
// Needs byte to string casting for map values
484481
for k, v := range secret {
485-
flags[k] = string(v)
482+
flags[k] = v
486483
}
487484
} else {
488485
klog.Infof("No csi-rclone connection defaults secret found.")
@@ -543,7 +540,7 @@ func decryptSecrets(flags map[string]string, savedPvcSecret *v1.Secret) (map[str
543540

544541
if len(savedPvcSecret.Data) > 0 {
545542
for k, v := range savedPvcSecret.Data {
546-
savedSecrets[k] = string(fernet.VerifyAndDecrypt([]byte(v), 0, []*fernet.Key{fernetKey}))
543+
savedSecrets[k] = string(fernet.VerifyAndDecrypt(v, 0, []*fernet.Key{fernetKey}))
547544
}
548545
}
549546

@@ -585,7 +582,7 @@ func extractConfigData(parameters map[string]string) (string, map[string]string)
585582
}
586583

587584
// Unmounting Volumes
588-
func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
585+
func (ns *NodeServer) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
589586
klog.Infof("NodeUnpublishVolume called with: %s", req)
590587
if err := validateUnPublishVolumeRequest(req); err != nil {
591588
return nil, err
@@ -614,7 +611,7 @@ func validateUnPublishVolumeRequest(req *csi.NodeUnpublishVolumeRequest) error {
614611
}
615612

616613
// Resizing Volume
617-
func (*NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
614+
func (*NodeServer) NodeExpandVolume(_ context.Context, _ *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
618615
return nil, status.Errorf(codes.Unimplemented, "method NodeExpandVolume not implemented")
619616
}
620617

0 commit comments

Comments
 (0)