Added volume.Creater interface and simple HostPath implementation

This commit is contained in:
markturansky
2015-09-07 15:55:28 -04:00
parent 8e4b09df8f
commit 3bed0a2b5c
4 changed files with 114 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ package volume
import (
"io/ioutil"
"k8s.io/kubernetes/pkg/api"
"os"
"path"
)
@@ -65,6 +66,12 @@ type Recycler interface {
Recycle() error
}
// Create adds a new resource in the storage provider and creates a PersistentVolume for the new resource.
// Calls to Create should block until complete.
type Creater interface {
Create() (*api.PersistentVolume, error)
}
// Delete removes the resource from the underlying storage provider. Calls to this method should block until
// the deletion is complete. Any error returned indicates the volume has failed to be reclaimed.
// A nil return indicates success.