Unverified Commit f61a8dd9 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #71586 from harsh-px/automated-cherry-pick-of-#70392-upstream-release-1.13

Automated cherry pick of #70392: Lookup PX api port from k8s service
parents 190aab48 29bea17b
......@@ -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