Skip to content

Commit

Permalink
Merge pull request #138 from lpabon/rel1.0
Browse files Browse the repository at this point in the history
Update to v1.0.0-RC2 of CSI
  • Loading branch information
k8s-ci-robot authored Nov 15, 2018
2 parents 93231de + 234407f commit 42947e0
Show file tree
Hide file tree
Showing 30 changed files with 1,665 additions and 1,402 deletions.
68 changes: 55 additions & 13 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

[[constraint]]
name = "github.com/container-storage-interface/spec"
version = "~0.3.0"
version = "v1.0.0-rc2"

[[constraint]]
name = "github.com/golang/mock"
version = "1.0.0"

[[constraint]]
name = "github.com/golang/protobuf"
version = "v1.1.0"
version = "v1.2.0"

[[constraint]]
name = "github.com/onsi/ginkgo"
Expand Down
20 changes: 10 additions & 10 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//go:generate mockgen -package=driver -destination=driver.mock.go github.com/container-storage-interface/spec/lib/go/csi/v0 IdentityServer,ControllerServer,NodeServer
//go:generate mockgen -package=driver -destination=driver.mock.go github.com/container-storage-interface/spec/lib/go/csi IdentityServer,ControllerServer,NodeServer

package driver

Expand All @@ -29,7 +29,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/container-storage-interface/spec/lib/go/csi/v0"
"github.com/container-storage-interface/spec/lib/go/csi"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand Down Expand Up @@ -233,35 +233,35 @@ func isAuthenticated(req interface{}, creds *CSICreds) (bool, error) {
}

func authenticateCreateVolume(req *csi.CreateVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetControllerCreateSecrets(), creds.CreateVolumeSecret)
return credsCheck(req.GetSecrets(), creds.CreateVolumeSecret)
}

func authenticateDeleteVolume(req *csi.DeleteVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetControllerDeleteSecrets(), creds.DeleteVolumeSecret)
return credsCheck(req.GetSecrets(), creds.DeleteVolumeSecret)
}

func authenticateControllerPublishVolume(req *csi.ControllerPublishVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetControllerPublishSecrets(), creds.ControllerPublishVolumeSecret)
return credsCheck(req.GetSecrets(), creds.ControllerPublishVolumeSecret)
}

func authenticateControllerUnpublishVolume(req *csi.ControllerUnpublishVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetControllerUnpublishSecrets(), creds.ControllerUnpublishVolumeSecret)
return credsCheck(req.GetSecrets(), creds.ControllerUnpublishVolumeSecret)
}

func authenticateNodeStageVolume(req *csi.NodeStageVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetNodeStageSecrets(), creds.NodeStageVolumeSecret)
return credsCheck(req.GetSecrets(), creds.NodeStageVolumeSecret)
}

func authenticateNodePublishVolume(req *csi.NodePublishVolumeRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetNodePublishSecrets(), creds.NodePublishVolumeSecret)
return credsCheck(req.GetSecrets(), creds.NodePublishVolumeSecret)
}

func authenticateCreateSnapshot(req *csi.CreateSnapshotRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetCreateSnapshotSecrets(), creds.CreateSnapshotSecret)
return credsCheck(req.GetSecrets(), creds.CreateSnapshotSecret)
}

func authenticateDeleteSnapshot(req *csi.DeleteSnapshotRequest, creds *CSICreds) (bool, error) {
return credsCheck(req.GetDeleteSnapshotSecrets(), creds.DeleteSnapshotSecret)
return credsCheck(req.GetSecrets(), creds.DeleteSnapshotSecret)
}

func credsCheck(secrets map[string]string, secretVal string) (bool, error) {
Expand Down
Loading

0 comments on commit 42947e0

Please sign in to comment.