Unverified Commit b548d92b authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #70392 from harsh-px/cfg-port

Lookup PX api port from k8s service
parents 3faeb7ba fdc60629
......@@ -20,6 +20,7 @@ import (
"fmt"
"os"
volumeclient "github.com/libopenstorage/openstorage/api/client/volume"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......@@ -43,7 +44,7 @@ func ProbeVolumePlugins() []volume.VolumePlugin {
type portworxVolumePlugin struct {
host volume.VolumeHost
util *PortworxVolumeUtil
util *portworxVolumeUtil
}
var _ volume.VolumePlugin = &portworxVolumePlugin{}
......@@ -61,8 +62,18 @@ func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
}
func (plugin *portworxVolumePlugin) Init(host volume.VolumeHost) error {
client, err := volumeclient.NewDriverClient(
fmt.Sprintf("http://%s:%d", host.GetHostName(), osdMgmtDefaultPort),
pxdDriverName, osdDriverVersion, pxDriverName)
if err != nil {
return err
}
plugin.host = host
plugin.util = &PortworxVolumeUtil{}
plugin.util = &portworxVolumeUtil{
portworxClient: client,
}
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment