-
Notifications
You must be signed in to change notification settings - Fork 18
Support using symlinks to find correct driver #127
Conversation
61a875b
to
28094a3
Compare
5caac59
to
67e0bd5
Compare
7377b02
to
26e9c2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes but generally looking good 👍
cmd/oci/main.go
Outdated
flexvolume.ExecDriver(&driver.OCIFlexvolumeDriver{}, os.Args) | ||
|
||
drivers := map[string]flexvolume.Driver{ | ||
"oci-bvs": &driver.OCIFlexvolumeDriver{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we use a registration mechanism for drivers like in the CCM's RegisterCloudProvider()
.
pkg/flexvolume/flexvolume.go
Outdated
@@ -82,26 +86,6 @@ type Driver interface { | |||
Unmount(mountDir string) DriverStatus | |||
} | |||
|
|||
// ExitWithResult outputs the given Result and exits with the appropriate exit | |||
// code. | |||
func ExitWithResult(result DriverStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst hoisting ExitWithResult
out of ExecDriver
is a good idea, I don't see where you've re-implemented outputting the JSON to stdout. I'd suggest keeping this code and calling it from main.go
.
pkg/flexvolume/flexvolume_test.go
Outdated
bak := out | ||
out = new(bytes.Buffer) | ||
defer func() { out = bak }() | ||
status := ExecDriver(map[string]Driver{"oci-bvs": mockFlexvolumeDriver{}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: personally find the following more readable:
status := ExecDriver(
map[string]Driver{"oci-bvs": mockFlexvolumeDriver{}},
[]string{"oci", "getvolumename", defaultTestOps},
)
pkg/flexvolume/flexvolume.go
Outdated
@@ -143,127 +144,143 @@ func processOpts(optsStr string) (Options, error) { | |||
|
|||
// ExecDriver executes the appropriate FlexvolumeDriver command based on | |||
// recieved call-out. | |||
func ExecDriver(driver Driver, args []string) { | |||
func ExecDriver(drivers map[string]Driver, args []string) DriverStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we implement the driver selection logic elsewhere and then pass it into ExecDriver
as before rather than overloading ExecDriver
.
1ce1c73
to
fbf6928
Compare
fbf6928
to
c696bfd
Compare
Update image name
…acle/oci-flexvolume-driver into symlink-flexvolume-driver-provisioner
…acle/oci-flexvolume-driver into symlink-flexvolume-driver-provisioner
…ume-driver yaml manifest
…acle/oci-flexvolume-driver into symlink-flexvolume-driver-provisioner
Addresses oracle/oci-volume-provisioner#131
The volume provisioner has been patched to now not use names to dispatch custom logic. A storage class can now use it's provisioner property to determine what driver should be used. At the moment only block volume storage is supported
provisioner: oracle.com/oci-bvs
with aim that file storage will soon be supported also oracle/oci-volume-provisioner#90. Backwards compatible so that existing storage classes usingprovisioner: oracle.com/oci
will default to using the block volume storage however this should be marked as deprecated and removed in a future release.