Upgrade csi-spec, fix tests
This commit is contained in:
parent
4e8bbf0126
commit
c6b3b5199d
8 changed files with 67 additions and 44 deletions
|
@ -131,7 +131,7 @@ func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
|
|||
}
|
||||
if exists {
|
||||
if err := s3.removeBucket(volumeID); err != nil {
|
||||
glog.V(3).Infof("Failed to remove volume: %v", err)
|
||||
glog.V(3).Infof("Failed to remove volume %s: %v", volumeID, err)
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
|
@ -186,6 +186,10 @@ func (cs *controllerServer) ValidateVolumeCapabilities(ctx context.Context, req
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (cs *controllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
|
||||
return &csi.ControllerExpandVolumeResponse{}, status.Error(codes.Unimplemented, "ControllerExpandVolume is not implemented")
|
||||
}
|
||||
|
||||
func sanitizeVolumeID(volumeID string) string {
|
||||
volumeID = strings.ToLower(volumeID)
|
||||
if len(volumeID) > 63 {
|
||||
|
|
|
@ -194,6 +194,10 @@ func (ns *nodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetC
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (ns *nodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
|
||||
return &csi.NodeExpandVolumeResponse{}, status.Error(codes.Unimplemented, "NodeExpandVolume is not implemented")
|
||||
}
|
||||
|
||||
func checkMount(targetPath string) (bool, error) {
|
||||
notMnt, err := mount.New("").IsLikelyNotMountPoint(targetPath)
|
||||
if err != nil {
|
||||
|
|
|
@ -120,7 +120,8 @@ func (client *s3Client) emptyBucket(bucketName string) error {
|
|||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
// ensure our prefix is also removed
|
||||
return client.minio.RemoveObject(bucketName, fsPrefix)
|
||||
}
|
||||
|
||||
func (client *s3Client) setBucket(bucket *bucket) error {
|
||||
|
|
|
@ -1,25 +1,17 @@
|
|||
package s3_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/ctrox/csi-s3/pkg/s3"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/ctrox/csi-s3/pkg/s3"
|
||||
"github.com/kubernetes-csi/csi-test/pkg/sanity"
|
||||
)
|
||||
|
||||
var _ = Describe("S3Driver", func() {
|
||||
mntDir, _ := ioutil.TempDir("", "mnt")
|
||||
stagingDir, _ := ioutil.TempDir("", "staging")
|
||||
|
||||
AfterSuite(func() {
|
||||
os.RemoveAll(mntDir)
|
||||
os.RemoveAll(stagingDir)
|
||||
})
|
||||
|
||||
Context("goofys", func() {
|
||||
socket := "/tmp/csi-goofys.sock"
|
||||
|
@ -35,8 +27,8 @@ var _ = Describe("S3Driver", func() {
|
|||
|
||||
Describe("CSI sanity", func() {
|
||||
sanityCfg := &sanity.Config{
|
||||
TargetPath: mntDir,
|
||||
StagingPath: stagingDir,
|
||||
TargetPath: os.TempDir() + "/goofys-target",
|
||||
StagingPath: os.TempDir() + "/goofys-staging",
|
||||
Address: csiEndpoint,
|
||||
SecretsFile: "../../test/secret.yaml",
|
||||
TestVolumeParameters: map[string]string{
|
||||
|
@ -61,8 +53,8 @@ var _ = Describe("S3Driver", func() {
|
|||
|
||||
Describe("CSI sanity", func() {
|
||||
sanityCfg := &sanity.Config{
|
||||
TargetPath: mntDir,
|
||||
StagingPath: stagingDir,
|
||||
TargetPath: os.TempDir() + "/s3fs-target",
|
||||
StagingPath: os.TempDir() + "/s3fs-staging",
|
||||
Address: csiEndpoint,
|
||||
SecretsFile: "../../test/secret.yaml",
|
||||
TestVolumeParameters: map[string]string{
|
||||
|
@ -86,12 +78,10 @@ var _ = Describe("S3Driver", func() {
|
|||
}
|
||||
go driver.Run()
|
||||
|
||||
defer os.RemoveAll(mntDir)
|
||||
|
||||
Describe("CSI sanity", func() {
|
||||
sanityCfg := &sanity.Config{
|
||||
TargetPath: mntDir,
|
||||
StagingPath: stagingDir,
|
||||
TargetPath: os.TempDir() + "/s3ql-target",
|
||||
StagingPath: os.TempDir() + "/s3ql-staging",
|
||||
Address: csiEndpoint,
|
||||
SecretsFile: "../../test/secret.yaml",
|
||||
TestVolumeParameters: map[string]string{
|
||||
|
@ -119,8 +109,8 @@ var _ = Describe("S3Driver", func() {
|
|||
|
||||
Describe("CSI sanity", func() {
|
||||
sanityCfg := &sanity.Config{
|
||||
TargetPath: mntDir,
|
||||
StagingPath: stagingDir,
|
||||
TargetPath: os.TempDir() + "/s3backer-target",
|
||||
StagingPath: os.TempDir() + "/s3backer-staging",
|
||||
Address: csiEndpoint,
|
||||
SecretsFile: "../../test/secret.yaml",
|
||||
TestVolumeParameters: map[string]string{
|
||||
|
@ -146,8 +136,8 @@ var _ = Describe("S3Driver", func() {
|
|||
|
||||
Describe("CSI sanity", func() {
|
||||
sanityCfg := &sanity.Config{
|
||||
TargetPath: mntDir,
|
||||
StagingPath: stagingDir,
|
||||
TargetPath: os.TempDir() + "/rclone-target",
|
||||
StagingPath: os.TempDir() + "/rclone-staging",
|
||||
Address: csiEndpoint,
|
||||
SecretsFile: "../../test/secret.yaml",
|
||||
TestVolumeParameters: map[string]string{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue