Bump github.com/kubernetes-csi/csi-test/v4 from 4.0.2 to 4.4.0

Bumps [github.com/kubernetes-csi/csi-test/v4](https://github.com/kubernetes-csi/csi-test) from 4.0.2 to 4.4.0.
- [Release notes](https://github.com/kubernetes-csi/csi-test/releases)
- [Commits](https://github.com/kubernetes-csi/csi-test/compare/v4.0.2...v4.4.0)

---
updated-dependencies:
- dependency-name: github.com/kubernetes-csi/csi-test/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-06-12 17:05:14 +00:00
committed by GitHub
parent 58017e7246
commit 655d43bc96
18 changed files with 69 additions and 1862 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2019 Kubernetes Authors
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2019 Kubernetes Authors
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 Luis Pabón luis@portworx.com
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"k8s.io/klog"
"k8s.io/klog/v2"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc"
@@ -65,6 +65,7 @@ type CSICreds struct {
CreateSnapshotSecret string
DeleteSnapshotSecret string
ControllerValidateVolumeCapabilitiesSecret string
ListSnapshotsSecret string
}
type CSIDriver struct {
@@ -184,6 +185,7 @@ func setDefaultCreds(creds *CSICreds) {
CreateSnapshotSecret: "secretval7",
DeleteSnapshotSecret: "secretval8",
ControllerValidateVolumeCapabilitiesSecret: "secretval9",
ListSnapshotsSecret: "secretval10",
}
}
@@ -235,7 +237,10 @@ func logGRPC(method string, request, reply interface{}, err error) {
logMessage.Error = err.Error()
}
msg, _ := json.Marshal(logMessage)
msg, err := json.Marshal(logMessage)
if err != nil {
logMessage.Error = err.Error()
}
klog.V(3).Infof("gRPCCall: %s\n", msg)
}
@@ -259,6 +264,8 @@ func isAuthenticated(req interface{}, creds *CSICreds) (bool, error) {
return authenticateDeleteSnapshot(r, creds)
case *csi.ValidateVolumeCapabilitiesRequest:
return authenticateControllerValidateVolumeCapabilities(r, creds)
case *csi.ListSnapshotsRequest:
return authenticateListSnapshots(r, creds)
default:
return true, nil
}
@@ -300,6 +307,10 @@ func authenticateControllerValidateVolumeCapabilities(req *csi.ValidateVolumeCap
return credsCheck(req.GetSecrets(), creds.ControllerValidateVolumeCapabilitiesSecret)
}
func authenticateListSnapshots(req *csi.ListSnapshotsRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetSecrets(), creds.ListSnapshotsSecret)
}
func credsCheck(secrets map[string]string, secretVal string) (bool, error) {
if len(secrets) == 0 {
return false, ErrNoCredentials

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 Luis Pabón luis@portworx.com
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 Luis Pabón luis@portworx.com
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.