diff --git a/client/go.mod b/client/go.mod index 85501884..5fedd036 100644 --- a/client/go.mod +++ b/client/go.mod @@ -1,11 +1,11 @@ module github.com/kubernetes-csi/csi-proxy/client -go 1.12 +go 1.16 require ( - github.com/Microsoft/go-winio v0.4.14 + github.com/Microsoft/go-winio v0.4.16 github.com/golang/protobuf v1.4.1 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.2.2 google.golang.org/grpc v1.27.0 google.golang.org/protobuf v1.25.0 diff --git a/client/go.sum b/client/go.sum index 7b2beee3..a5931e29 100644 --- a/client/go.sum +++ b/client/go.sum @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -30,6 +32,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -56,6 +60,8 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/client/groups/disk/v1/client_generated.go b/client/groups/disk/v1/client_generated.go index 55dee4f9..600c9e70 100644 --- a/client/groups/disk/v1/client_generated.go +++ b/client/groups/disk/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "disk" +// GroupName is the group name of this API. +const GroupName = "disk" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.DiskClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the disk API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/disk/v1alpha1/client_generated.go b/client/groups/disk/v1alpha1/client_generated.go index 24039622..c05d16de 100644 --- a/client/groups/disk/v1alpha1/client_generated.go +++ b/client/groups/disk/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "disk" +// GroupName is the group name of this API. +const GroupName = "disk" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.DiskClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the disk API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/disk/v1beta1/client_generated.go b/client/groups/disk/v1beta1/client_generated.go index 3ecd7c3b..a3179948 100644 --- a/client/groups/disk/v1beta1/client_generated.go +++ b/client/groups/disk/v1beta1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "disk" +// GroupName is the group name of this API. +const GroupName = "disk" -var version = apiversion.NewVersionOrPanic("v1beta1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta1") type Client struct { client v1beta1.DiskClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the disk API group version v1beta1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/disk/v1beta2/client_generated.go b/client/groups/disk/v1beta2/client_generated.go index a5e85d81..95866cde 100644 --- a/client/groups/disk/v1beta2/client_generated.go +++ b/client/groups/disk/v1beta2/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "disk" +// GroupName is the group name of this API. +const GroupName = "disk" -var version = apiversion.NewVersionOrPanic("v1beta2") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta2") type Client struct { client v1beta2.DiskClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the disk API group version v1beta2. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/filesystem/v1/client_generated.go b/client/groups/filesystem/v1/client_generated.go index 316d400c..d3c9d858 100644 --- a/client/groups/filesystem/v1/client_generated.go +++ b/client/groups/filesystem/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "filesystem" +// GroupName is the group name of this API. +const GroupName = "filesystem" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.FilesystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the filesystem API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/filesystem/v1alpha1/client_generated.go b/client/groups/filesystem/v1alpha1/client_generated.go index b6f23557..04849011 100644 --- a/client/groups/filesystem/v1alpha1/client_generated.go +++ b/client/groups/filesystem/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "filesystem" +// GroupName is the group name of this API. +const GroupName = "filesystem" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.FilesystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the filesystem API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/filesystem/v1beta1/client_generated.go b/client/groups/filesystem/v1beta1/client_generated.go index a68e86fa..b7584725 100644 --- a/client/groups/filesystem/v1beta1/client_generated.go +++ b/client/groups/filesystem/v1beta1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "filesystem" +// GroupName is the group name of this API. +const GroupName = "filesystem" -var version = apiversion.NewVersionOrPanic("v1beta1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta1") type Client struct { client v1beta1.FilesystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the filesystem API group version v1beta1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/iscsi/v1alpha1/client_generated.go b/client/groups/iscsi/v1alpha1/client_generated.go index d4e75b61..fbb4df0a 100644 --- a/client/groups/iscsi/v1alpha1/client_generated.go +++ b/client/groups/iscsi/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "iscsi" +// GroupName is the group name of this API. +const GroupName = "iscsi" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.IscsiClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the iscsi API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/iscsi/v1alpha2/client_generated.go b/client/groups/iscsi/v1alpha2/client_generated.go index dd7c30c3..2d195a97 100644 --- a/client/groups/iscsi/v1alpha2/client_generated.go +++ b/client/groups/iscsi/v1alpha2/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "iscsi" +// GroupName is the group name of this API. +const GroupName = "iscsi" -var version = apiversion.NewVersionOrPanic("v1alpha2") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha2") type Client struct { client v1alpha2.IscsiClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the iscsi API group version v1alpha2. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/smb/v1/client_generated.go b/client/groups/smb/v1/client_generated.go index a64e6997..a154fd33 100644 --- a/client/groups/smb/v1/client_generated.go +++ b/client/groups/smb/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "smb" +// GroupName is the group name of this API. +const GroupName = "smb" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.SmbClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the smb API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/smb/v1alpha1/client_generated.go b/client/groups/smb/v1alpha1/client_generated.go index 4cdc0e83..45186cae 100644 --- a/client/groups/smb/v1alpha1/client_generated.go +++ b/client/groups/smb/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "smb" +// GroupName is the group name of this API. +const GroupName = "smb" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.SmbClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the smb API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/smb/v1beta1/client_generated.go b/client/groups/smb/v1beta1/client_generated.go index 25f52e23..9796ccb1 100644 --- a/client/groups/smb/v1beta1/client_generated.go +++ b/client/groups/smb/v1beta1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "smb" +// GroupName is the group name of this API. +const GroupName = "smb" -var version = apiversion.NewVersionOrPanic("v1beta1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta1") type Client struct { client v1beta1.SmbClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the smb API group version v1beta1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/system/v1alpha1/client_generated.go b/client/groups/system/v1alpha1/client_generated.go index 9cbc5268..3cd2cb21 100644 --- a/client/groups/system/v1alpha1/client_generated.go +++ b/client/groups/system/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "system" +// GroupName is the group name of this API. +const GroupName = "system" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.SystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the system API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/volume/v1/client_generated.go b/client/groups/volume/v1/client_generated.go index 68f45d5e..7bf386b6 100644 --- a/client/groups/volume/v1/client_generated.go +++ b/client/groups/volume/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/volume/v1alpha1/client_generated.go b/client/groups/volume/v1alpha1/client_generated.go index d6869380..69d16961 100644 --- a/client/groups/volume/v1alpha1/client_generated.go +++ b/client/groups/volume/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/volume/v1beta1/client_generated.go b/client/groups/volume/v1beta1/client_generated.go index 8e3d2e80..9fca55dc 100644 --- a/client/groups/volume/v1beta1/client_generated.go +++ b/client/groups/volume/v1beta1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1beta1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta1") type Client struct { client v1beta1.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1beta1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/client/groups/volume/v1beta2/client_generated.go b/client/groups/volume/v1beta2/client_generated.go index a558a042..9ae1da37 100644 --- a/client/groups/volume/v1beta2/client_generated.go +++ b/client/groups/volume/v1beta2/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1beta2") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1beta2") type Client struct { client v1beta2.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1beta2. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/cmd/csi-proxy-api-gen/generators/client_generated_gen.go b/cmd/csi-proxy-api-gen/generators/client_generated_gen.go index c6899013..74ebc349 100644 --- a/cmd/csi-proxy-api-gen/generators/client_generated_gen.go +++ b/cmd/csi-proxy-api-gen/generators/client_generated_gen.go @@ -44,9 +44,11 @@ func (g *clientGeneratedGenerator) Init(context *generator.Context, writer io.Wr snippetWriter := generator.NewSnippetWriter(writer, context, "$", "$") snippetWriter.Do(` -const groupName = "$.groupName$" +// GroupName is the group name of this API. +const GroupName = "$.groupName$" -var version = apiversion.NewVersionOrPanic("$.version$") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("$.version$") type Client struct { client $.version$.$.camelGroupName$Client @@ -56,7 +58,19 @@ type Client struct { // NewClient returns a client to make calls to the $.groupName$ API group version $.version$. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/go.mod b/go.mod index 1ede06fb..9b569eb7 100644 --- a/go.mod +++ b/go.mod @@ -13,12 +13,12 @@ replace ( ) require ( - github.com/Microsoft/go-winio v0.4.14 + github.com/Microsoft/go-winio v0.4.16 github.com/golang/protobuf v1.4.1 github.com/google/go-cmp v0.5.0 github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 github.com/kubernetes-csi/csi-proxy/client v0.0.0-00010101000000-000000000000 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/sergi/go-diff v1.0.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum index 8eb17c13..79595fc5 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -33,8 +33,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 h1:ECW73yc9MY7935nNYXUkK7Dz17YuSUI9yqRqYS8aBww= github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -68,7 +68,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/integrationtests/apigroups/client/dummy/v1/client_generated.go b/integrationtests/apigroups/client/dummy/v1/client_generated.go index 2cd634f4..7eed6341 100644 --- a/integrationtests/apigroups/client/dummy/v1/client_generated.go +++ b/integrationtests/apigroups/client/dummy/v1/client_generated.go @@ -9,13 +9,15 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" "github.com/kubernetes-csi/csi-proxy/client/apiversion" - v1 "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy/v1" + "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy/v1" "google.golang.org/grpc" ) -const groupName = "dummy" +// GroupName is the group name of this API. +const GroupName = "dummy" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.DummyClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the dummy API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/integrationtests/apigroups/client/dummy/v1alpha1/client_generated.go b/integrationtests/apigroups/client/dummy/v1alpha1/client_generated.go index 182c3d31..6a236d45 100644 --- a/integrationtests/apigroups/client/dummy/v1alpha1/client_generated.go +++ b/integrationtests/apigroups/client/dummy/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "dummy" +// GroupName is the group name of this API. +const GroupName = "dummy" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.DummyClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the dummy API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/integrationtests/apigroups/client/dummy/v1alpha2/client_generated.go b/integrationtests/apigroups/client/dummy/v1alpha2/client_generated.go index d0a4df6c..4004d0d3 100644 --- a/integrationtests/apigroups/client/dummy/v1alpha2/client_generated.go +++ b/integrationtests/apigroups/client/dummy/v1alpha2/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "dummy" +// GroupName is the group name of this API. +const GroupName = "dummy" -var version = apiversion.NewVersionOrPanic("v1alpha2") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha2") type Client struct { client v1alpha2.DummyClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the dummy API group version v1alpha2. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/integrationtests/apigroups/server/dummy/api_group_generated.go b/integrationtests/apigroups/server/dummy/api_group_generated.go index 8a8ea9bb..1bb67d46 100644 --- a/integrationtests/apigroups/server/dummy/api_group_generated.go +++ b/integrationtests/apigroups/server/dummy/api_group_generated.go @@ -5,7 +5,7 @@ package dummy import ( "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal" - v1 "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal/v1" + "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal/v1" "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal/v1alpha1" "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal/v1alpha2" srvtypes "github.com/kubernetes-csi/csi-proxy/internal/server/types" diff --git a/integrationtests/apigroups/server/dummy/internal/v1/server_generated.go b/integrationtests/apigroups/server/dummy/internal/v1/server_generated.go index cac51292..349566d1 100644 --- a/integrationtests/apigroups/server/dummy/internal/v1/server_generated.go +++ b/integrationtests/apigroups/server/dummy/internal/v1/server_generated.go @@ -6,7 +6,7 @@ import ( "context" "github.com/kubernetes-csi/csi-proxy/client/apiversion" - v1 "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy/v1" + "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy/v1" "github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/server/dummy/internal" "google.golang.org/grpc" ) diff --git a/internal/server/disk/api_group_generated.go b/internal/server/disk/api_group_generated.go index 20a9c326..772590ef 100644 --- a/internal/server/disk/api_group_generated.go +++ b/internal/server/disk/api_group_generated.go @@ -5,7 +5,7 @@ package disk import ( "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal" - v1 "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal/v1" + "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal/v1" "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal/v1alpha1" "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal/v1beta1" "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal/v1beta2" diff --git a/internal/server/disk/internal/v1/server_generated.go b/internal/server/disk/internal/v1/server_generated.go index 46e5d42c..f4e777a0 100644 --- a/internal/server/disk/internal/v1/server_generated.go +++ b/internal/server/disk/internal/v1/server_generated.go @@ -5,7 +5,7 @@ package v1 import ( "context" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/disk/internal" "google.golang.org/grpc" diff --git a/internal/server/filesystem/api_group_generated.go b/internal/server/filesystem/api_group_generated.go index 8ec66cbb..4b2d776a 100644 --- a/internal/server/filesystem/api_group_generated.go +++ b/internal/server/filesystem/api_group_generated.go @@ -5,7 +5,7 @@ package filesystem import ( "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal" - v1 "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal/v1" + "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal/v1" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal/v1alpha1" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal/v1beta1" srvtypes "github.com/kubernetes-csi/csi-proxy/internal/server/types" diff --git a/internal/server/filesystem/internal/v1/server_generated.go b/internal/server/filesystem/internal/v1/server_generated.go index d0875137..76f59b48 100644 --- a/internal/server/filesystem/internal/v1/server_generated.go +++ b/internal/server/filesystem/internal/v1/server_generated.go @@ -5,7 +5,7 @@ package v1 import ( "context" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/filesystem/internal" "google.golang.org/grpc" diff --git a/internal/server/smb/api_group_generated.go b/internal/server/smb/api_group_generated.go index b7581149..ede84725 100644 --- a/internal/server/smb/api_group_generated.go +++ b/internal/server/smb/api_group_generated.go @@ -5,7 +5,7 @@ package smb import ( "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal" - v1 "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal/v1" + "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal/v1" "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal/v1alpha1" "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal/v1beta1" srvtypes "github.com/kubernetes-csi/csi-proxy/internal/server/types" diff --git a/internal/server/smb/internal/v1/server_generated.go b/internal/server/smb/internal/v1/server_generated.go index 4a47d6ef..a6e78b76 100644 --- a/internal/server/smb/internal/v1/server_generated.go +++ b/internal/server/smb/internal/v1/server_generated.go @@ -5,7 +5,7 @@ package v1 import ( "context" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/smb/internal" "google.golang.org/grpc" diff --git a/internal/server/volume/api_group_generated.go b/internal/server/volume/api_group_generated.go index 1e4c0109..b64366b0 100644 --- a/internal/server/volume/api_group_generated.go +++ b/internal/server/volume/api_group_generated.go @@ -6,7 +6,7 @@ import ( "github.com/kubernetes-csi/csi-proxy/client/apiversion" srvtypes "github.com/kubernetes-csi/csi-proxy/internal/server/types" "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal" - v1 "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal/v1" + "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal/v1" "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal/v1alpha1" "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal/v1beta1" "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal/v1beta2" diff --git a/internal/server/volume/internal/v1/server_generated.go b/internal/server/volume/internal/v1/server_generated.go index fdc9c0fb..e8a2db36 100644 --- a/internal/server/volume/internal/v1/server_generated.go +++ b/internal/server/volume/internal/v1/server_generated.go @@ -5,7 +5,7 @@ package v1 import ( "context" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "github.com/kubernetes-csi/csi-proxy/internal/server/volume/internal" "google.golang.org/grpc" diff --git a/vendor/github.com/Microsoft/go-winio/go.mod b/vendor/github.com/Microsoft/go-winio/go.mod index b3846826..a2eb6496 100644 --- a/vendor/github.com/Microsoft/go-winio/go.mod +++ b/vendor/github.com/Microsoft/go-winio/go.mod @@ -3,7 +3,7 @@ module github.com/Microsoft/go-winio go 1.12 require ( - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.4.1 - golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b + golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 ) diff --git a/vendor/github.com/Microsoft/go-winio/go.sum b/vendor/github.com/Microsoft/go-winio/go.sum index babb4a70..6da76a49 100644 --- a/vendor/github.com/Microsoft/go-winio/go.sum +++ b/vendor/github.com/Microsoft/go-winio/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= @@ -12,5 +12,5 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go index d6a46f6a..96700a73 100644 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ b/vendor/github.com/Microsoft/go-winio/pipe.go @@ -182,13 +182,14 @@ func (s pipeAddress) String() string { } // tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) { +func tryDialPipe(ctx context.Context, path *string, access uint32) (syscall.Handle, error) { for { + select { case <-ctx.Done(): return syscall.Handle(0), ctx.Err() default: - h, err := createFile(*path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRESENT|cSECURITY_ANONYMOUS, 0) + h, err := createFile(*path, access, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRESENT|cSECURITY_ANONYMOUS, 0) if err == nil { return h, nil } @@ -197,7 +198,7 @@ func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) { } // Wait 10 msec and try again. This is a rather simplistic // view, as we always try each 10 milliseconds. - time.Sleep(time.Millisecond * 10) + time.Sleep(10 * time.Millisecond) } } } @@ -210,7 +211,7 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { if timeout != nil { absTimeout = time.Now().Add(*timeout) } else { - absTimeout = time.Now().Add(time.Second * 2) + absTimeout = time.Now().Add(2 * time.Second) } ctx, _ := context.WithDeadline(context.Background(), absTimeout) conn, err := DialPipeContext(ctx, path) @@ -223,9 +224,15 @@ func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { // DialPipeContext attempts to connect to a named pipe by `path` until `ctx` // cancellation or timeout. func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { + return DialPipeAccess(ctx, path, syscall.GENERIC_READ|syscall.GENERIC_WRITE) +} + +// DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` +// cancellation or timeout. +func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { var err error var h syscall.Handle - h, err = tryDialPipe(ctx, &path) + h, err = tryDialPipe(ctx, &path, access) if err != nil { return nil, err } @@ -422,10 +429,10 @@ type PipeConfig struct { // when the pipe is in message mode. MessageMode bool - // InputBufferSize specifies the size the input buffer, in bytes. + // InputBufferSize specifies the size of the input buffer, in bytes. InputBufferSize int32 - // OutputBufferSize specifies the size the input buffer, in bytes. + // OutputBufferSize specifies the size of the output buffer, in bytes. OutputBufferSize int32 } diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod index 85501884..5fedd036 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod @@ -1,11 +1,11 @@ module github.com/kubernetes-csi/csi-proxy/client -go 1.12 +go 1.16 require ( - github.com/Microsoft/go-winio v0.4.14 + github.com/Microsoft/go-winio v0.4.16 github.com/golang/protobuf v1.4.1 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.2.2 google.golang.org/grpc v1.27.0 google.golang.org/protobuf v1.25.0 diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum index 7b2beee3..a5931e29 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -30,6 +32,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -56,6 +60,8 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go index 55dee4f9..600c9e70 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "disk" +// GroupName is the group name of this API. +const GroupName = "disk" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.DiskClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the disk API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go index 316d400c..d3c9d858 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "filesystem" +// GroupName is the group name of this API. +const GroupName = "filesystem" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.FilesystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the filesystem API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2/client_generated.go index dd7c30c3..2d195a97 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "iscsi" +// GroupName is the group name of this API. +const GroupName = "iscsi" -var version = apiversion.NewVersionOrPanic("v1alpha2") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha2") type Client struct { client v1alpha2.IscsiClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the iscsi API group version v1alpha2. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1/client_generated.go index a64e6997..a154fd33 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/smb/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "smb" +// GroupName is the group name of this API. +const GroupName = "smb" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.SmbClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the smb API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/system/v1alpha1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/system/v1alpha1/client_generated.go index 9cbc5268..3cd2cb21 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/system/v1alpha1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/system/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "system" +// GroupName is the group name of this API. +const GroupName = "system" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.SystemClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the system API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go index 68f45d5e..7bf386b6 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go @@ -8,14 +8,16 @@ import ( "github.com/Microsoft/go-winio" "github.com/kubernetes-csi/csi-proxy/client" - v1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" + "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" "github.com/kubernetes-csi/csi-proxy/client/apiversion" "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1") type Client struct { client v1.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1alpha1/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1alpha1/client_generated.go index d6869380..69d16961 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1alpha1/client_generated.go +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1alpha1/client_generated.go @@ -13,9 +13,11 @@ import ( "google.golang.org/grpc" ) -const groupName = "volume" +// GroupName is the group name of this API. +const GroupName = "volume" -var version = apiversion.NewVersionOrPanic("v1alpha1") +// Version is the api version. +var Version = apiversion.NewVersionOrPanic("v1alpha1") type Client struct { client v1alpha1.VolumeClient @@ -25,7 +27,19 @@ type Client struct { // NewClient returns a client to make calls to the volume API group version v1alpha1. // It's the caller's responsibility to Close the client when done. func NewClient() (*Client, error) { - pipePath := client.PipePath(groupName, version) + pipePath := client.PipePath(GroupName, Version) + return NewClientWithPipePath(pipePath) +} + +// NewClientWithPipePath returns a client to make calls to the named pipe located at "pipePath". +// It's the caller's responsibility to Close the client when done. +func NewClientWithPipePath(pipePath string) (*Client, error) { + + // verify that the pipe exists + _, err := winio.DialPipe(pipePath, nil) + if err != nil { + return nil, err + } connection, err := grpc.Dial(pipePath, grpc.WithContextDialer(func(context context.Context, s string) (net.Conn, error) { diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml index d4b92663..9159de03 100644 --- a/vendor/github.com/pkg/errors/.travis.yml +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -1,15 +1,10 @@ language: go go_import_path: github.com/pkg/errors go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - 1.11.x + - 1.12.x + - 1.13.x - tip script: - - go test -v ./... + - make check diff --git a/vendor/github.com/pkg/errors/Makefile b/vendor/github.com/pkg/errors/Makefile new file mode 100644 index 00000000..ce9d7cde --- /dev/null +++ b/vendor/github.com/pkg/errors/Makefile @@ -0,0 +1,44 @@ +PKGS := github.com/pkg/errors +SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) +GO := go + +check: test vet gofmt misspell unconvert staticcheck ineffassign unparam + +test: + $(GO) test $(PKGS) + +vet: | test + $(GO) vet $(PKGS) + +staticcheck: + $(GO) get honnef.co/go/tools/cmd/staticcheck + staticcheck -checks all $(PKGS) + +misspell: + $(GO) get github.com/client9/misspell/cmd/misspell + misspell \ + -locale GB \ + -error \ + *.md *.go + +unconvert: + $(GO) get github.com/mdempsky/unconvert + unconvert -v $(PKGS) + +ineffassign: + $(GO) get github.com/gordonklaus/ineffassign + find $(SRCDIRS) -name '*.go' | xargs ineffassign + +pedantic: check errcheck + +unparam: + $(GO) get mvdan.cc/unparam + unparam ./... + +errcheck: + $(GO) get github.com/kisielk/errcheck + errcheck $(PKGS) + +gofmt: + @echo Checking code is gofmted + @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md index 6483ba2a..54dfdcb1 100644 --- a/vendor/github.com/pkg/errors/README.md +++ b/vendor/github.com/pkg/errors/README.md @@ -41,11 +41,18 @@ default: [Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). +## Roadmap + +With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows: + +- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible) +- 1.0. Final release. + ## Contributing -We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. +Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. -Before proposing a change, please discuss your change by raising an issue. +Before sending a PR, please discuss your change by raising an issue. ## License diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go index 7421f326..161aea25 100644 --- a/vendor/github.com/pkg/errors/errors.go +++ b/vendor/github.com/pkg/errors/errors.go @@ -82,7 +82,7 @@ // // if err, ok := err.(stackTracer); ok { // for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d", f) +// fmt.Printf("%+s:%d\n", f, f) // } // } // @@ -159,6 +159,9 @@ type withStack struct { func (w *withStack) Cause() error { return w.error } +// Unwrap provides compatibility for Go 1.13 error chains. +func (w *withStack) Unwrap() error { return w.error } + func (w *withStack) Format(s fmt.State, verb rune) { switch verb { case 'v': @@ -241,6 +244,9 @@ type withMessage struct { func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } func (w *withMessage) Cause() error { return w.cause } +// Unwrap provides compatibility for Go 1.13 error chains. +func (w *withMessage) Unwrap() error { return w.cause } + func (w *withMessage) Format(s fmt.State, verb rune) { switch verb { case 'v': diff --git a/vendor/github.com/pkg/errors/go113.go b/vendor/github.com/pkg/errors/go113.go new file mode 100644 index 00000000..be0d10d0 --- /dev/null +++ b/vendor/github.com/pkg/errors/go113.go @@ -0,0 +1,38 @@ +// +build go1.13 + +package errors + +import ( + stderrors "errors" +) + +// Is reports whether any error in err's chain matches target. +// +// The chain consists of err itself followed by the sequence of errors obtained by +// repeatedly calling Unwrap. +// +// An error is considered to match a target if it is equal to that target or if +// it implements a method Is(error) bool such that Is(target) returns true. +func Is(err, target error) bool { return stderrors.Is(err, target) } + +// As finds the first error in err's chain that matches target, and if so, sets +// target to that error value and returns true. +// +// The chain consists of err itself followed by the sequence of errors obtained by +// repeatedly calling Unwrap. +// +// An error matches target if the error's concrete value is assignable to the value +// pointed to by target, or if the error has a method As(interface{}) bool such that +// As(target) returns true. In the latter case, the As method is responsible for +// setting target. +// +// As will panic if target is not a non-nil pointer to either a type that implements +// error, or to any interface type. As returns false if err is nil. +func As(err error, target interface{}) bool { return stderrors.As(err, target) } + +// Unwrap returns the result of calling the Unwrap method on err, if err's +// type contains an Unwrap method returning error. +// Otherwise, Unwrap returns nil. +func Unwrap(err error) error { + return stderrors.Unwrap(err) +} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go index 2874a048..779a8348 100644 --- a/vendor/github.com/pkg/errors/stack.go +++ b/vendor/github.com/pkg/errors/stack.go @@ -5,10 +5,13 @@ import ( "io" "path" "runtime" + "strconv" "strings" ) // Frame represents a program counter inside a stack frame. +// For historical reasons if Frame is interpreted as a uintptr +// its value represents the program counter + 1. type Frame uintptr // pc returns the program counter for this frame; @@ -37,6 +40,15 @@ func (f Frame) line() int { return line } +// name returns the name of this function, if known. +func (f Frame) name() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + return fn.Name() +} + // Format formats the frame according to the fmt.Formatter interface. // // %s source file @@ -54,22 +66,16 @@ func (f Frame) Format(s fmt.State, verb rune) { case 's': switch { case s.Flag('+'): - pc := f.pc() - fn := runtime.FuncForPC(pc) - if fn == nil { - io.WriteString(s, "unknown") - } else { - file, _ := fn.FileLine(pc) - fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) - } + io.WriteString(s, f.name()) + io.WriteString(s, "\n\t") + io.WriteString(s, f.file()) default: io.WriteString(s, path.Base(f.file())) } case 'd': - fmt.Fprintf(s, "%d", f.line()) + io.WriteString(s, strconv.Itoa(f.line())) case 'n': - name := runtime.FuncForPC(f.pc()).Name() - io.WriteString(s, funcname(name)) + io.WriteString(s, funcname(f.name())) case 'v': f.Format(s, 's') io.WriteString(s, ":") @@ -77,6 +83,16 @@ func (f Frame) Format(s fmt.State, verb rune) { } } +// MarshalText formats a stacktrace Frame as a text string. The output is the +// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. +func (f Frame) MarshalText() ([]byte, error) { + name := f.name() + if name == "unknown" { + return []byte(name), nil + } + return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil +} + // StackTrace is stack of Frames from innermost (newest) to outermost (oldest). type StackTrace []Frame @@ -94,16 +110,30 @@ func (st StackTrace) Format(s fmt.State, verb rune) { switch { case s.Flag('+'): for _, f := range st { - fmt.Fprintf(s, "\n%+v", f) + io.WriteString(s, "\n") + f.Format(s, verb) } case s.Flag('#'): fmt.Fprintf(s, "%#v", []Frame(st)) default: - fmt.Fprintf(s, "%v", []Frame(st)) + st.formatSlice(s, verb) } case 's': - fmt.Fprintf(s, "%s", []Frame(st)) + st.formatSlice(s, verb) + } +} + +// formatSlice will format this StackTrace into the given buffer as a slice of +// Frame, only valid when called with '%s' or '%v'. +func (st StackTrace) formatSlice(s fmt.State, verb rune) { + io.WriteString(s, "[") + for i, f := range st { + if i > 0 { + io.WriteString(s, " ") + } + f.Format(s, verb) } + io.WriteString(s, "]") } // stack represents a stack of program counters. diff --git a/vendor/modules.txt b/vendor/modules.txt index 23e90660..b118d705 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/Microsoft/go-winio v0.4.14 +# github.com/Microsoft/go-winio v0.4.16 ## explicit github.com/Microsoft/go-winio github.com/Microsoft/go-winio/pkg/guid @@ -52,7 +52,7 @@ github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1 github.com/kubernetes-csi/csi-proxy/client/groups/system/v1alpha1 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1alpha1 -# github.com/pkg/errors v0.8.1 +# github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.0