mirror of
https://github.com/oracle/zfssa-csi-driver.git
synced 2025-08-31 20:37:13 +00:00
update dependencies to latest for testing and submission
This commit is contained in:
146
go.mod
146
go.mod
@@ -1,72 +1,100 @@
|
||||
module github.com/oracle/zfssa-csi-driver
|
||||
|
||||
go 1.13
|
||||
go 1.17
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.20.10
|
||||
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.20.10
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.20.11-rc.0
|
||||
k8s.io/apiserver => k8s.io/apiserver v0.20.10
|
||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.20.10
|
||||
k8s.io/client-go => k8s.io/client-go v0.20.10
|
||||
k8s.io/cloud-provider => k8s.io/cloud-provider v0.20.10
|
||||
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.20.10
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.20.11-rc.0
|
||||
k8s.io/component-base => k8s.io/component-base v0.20.10
|
||||
k8s.io/cri-api => k8s.io/cri-api v0.20.11-rc.0
|
||||
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.20.10
|
||||
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.20.10
|
||||
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.20.10
|
||||
k8s.io/kube-proxy => k8s.io/kube-proxy v0.20.10
|
||||
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.20.10
|
||||
k8s.io/kubelet => k8s.io/kubelet v0.20.10
|
||||
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.20.10
|
||||
k8s.io/metrics => k8s.io/metrics v0.20.10
|
||||
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.20.10
|
||||
k8s.io/api => k8s.io/api v0.24.3
|
||||
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.3
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.24.3
|
||||
k8s.io/apiserver => k8s.io/apiserver v0.24.3
|
||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.3
|
||||
k8s.io/client-go => k8s.io/client-go v0.24.3
|
||||
k8s.io/cloud-provider => k8s.io/cloud-provider v0.24.3
|
||||
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.24.3
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.24.3
|
||||
k8s.io/component-base => k8s.io/component-base v0.24.3
|
||||
k8s.io/component-helpers => k8s.io/component-helpers v0.24.3
|
||||
k8s.io/controller-manager => k8s.io/controller-manager v0.24.3
|
||||
k8s.io/cri-api => k8s.io/cri-api v0.24.3
|
||||
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.24.3
|
||||
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.24.3
|
||||
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.24.3
|
||||
k8s.io/kube-proxy => k8s.io/kube-proxy v0.24.3
|
||||
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.24.3
|
||||
k8s.io/kubectl => k8s.io/kubectl v0.24.3
|
||||
k8s.io/kubelet => k8s.io/kubelet v0.24.3
|
||||
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.24.3
|
||||
k8s.io/metrics => k8s.io/metrics v0.24.3
|
||||
k8s.io/mount-utils => k8s.io/mount-utils v0.24.3
|
||||
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.24.3
|
||||
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.24.3
|
||||
)
|
||||
|
||||
replace k8s.io/kubectl => k8s.io/kubectl v0.20.10
|
||||
|
||||
replace k8s.io/node-api => k8s.io/node-api v0.17.5
|
||||
|
||||
replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.20.10
|
||||
|
||||
replace k8s.io/sample-controller => k8s.io/sample-controller v0.20.10
|
||||
|
||||
require (
|
||||
github.com/container-storage-interface/spec v1.5.0
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/container-storage-interface/spec v1.6.0
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/googleapis/gnostic v0.5.5 // indirect
|
||||
github.com/kr/pretty v0.2.1 // indirect
|
||||
github.com/kubernetes-csi/csi-lib-iscsi v0.0.0-20210519140452-fd47a25d3e16
|
||||
github.com/kubernetes-csi/csi-lib-utils v0.10.0
|
||||
github.com/onsi/ginkgo v1.14.0 // indirect
|
||||
github.com/prometheus/client_golang v1.11.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
|
||||
golang.org/x/net v0.0.0-20210908191846-a5e095526f91
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
|
||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
|
||||
github.com/kubernetes-csi/csi-lib-iscsi v0.0.0-20220106022228-366f3190694e
|
||||
github.com/kubernetes-csi/csi-lib-utils v0.11.0
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
|
||||
google.golang.org/grpc v1.40.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
k8s.io/api v0.22.1 // indirect
|
||||
k8s.io/apimachinery v0.22.1
|
||||
k8s.io/apiserver v0.22.1 // indirect
|
||||
k8s.io/client-go v0.22.1
|
||||
k8s.io/component-base v0.22.1 // indirect
|
||||
k8s.io/apimachinery v0.24.3
|
||||
k8s.io/client-go v0.24.3
|
||||
k8s.io/klog v1.0.0
|
||||
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
|
||||
k8s.io/kubernetes v1.20.10
|
||||
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e
|
||||
k8s.io/kubernetes v1.24.3
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
|
||||
)
|
||||
|
||||
replace k8s.io/component-helpers => k8s.io/component-helpers v0.20.10
|
||||
|
||||
replace k8s.io/controller-manager => k8s.io/controller-manager v0.20.10
|
||||
|
||||
replace k8s.io/mount-utils => k8s.io/mount-utils v0.20.11-rc.0
|
||||
|
||||
replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.1
|
||||
require (
|
||||
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
|
||||
github.com/go-logr/logr v1.2.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.5 // indirect
|
||||
github.com/go-openapi/swag v0.19.14 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/gnostic v0.5.7-v3refs // indirect
|
||||
github.com/google/go-cmp v0.5.5 // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
github.com/google/uuid v1.1.2 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailru/easyjson v0.7.6 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/opencontainers/selinux v1.10.0 // indirect
|
||||
github.com/prometheus/client_golang v1.12.1 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
|
||||
google.golang.org/protobuf v1.27.1 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
k8s.io/api v0.24.3 // indirect
|
||||
k8s.io/apiserver v0.24.3 // indirect
|
||||
k8s.io/cloud-provider v0.24.3 // indirect
|
||||
k8s.io/component-base v0.24.3 // indirect
|
||||
k8s.io/component-helpers v0.24.3 // indirect
|
||||
k8s.io/klog/v2 v2.60.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
|
||||
k8s.io/mount-utils v0.24.3 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
||||
sigs.k8s.io/yaml v1.2.0 // indirect
|
||||
)
|
||||
|
@@ -6,15 +6,15 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/oracle/zfssa-csi-driver/pkg/utils"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
iscsi_lib "github.com/kubernetes-csi/csi-lib-iscsi/iscsi"
|
||||
"k8s.io/utils/mount"
|
||||
"github.com/oracle/zfssa-csi-driver/pkg/utils"
|
||||
"k8s.io/kubernetes/pkg/volume/util"
|
||||
"k8s.io/utils/mount"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
@@ -24,12 +24,12 @@ import (
|
||||
// A subset of the iscsiadm
|
||||
type IscsiAdmReturnValues int32
|
||||
|
||||
const(
|
||||
ISCSI_SUCCESS IscsiAdmReturnValues = 0
|
||||
ISCSI_ERR_SESS_NOT_FOUND = 2
|
||||
ISCSI_ERR_TRANS_TIMEOUT = 8
|
||||
ISCSI_ERR_ISCSID_NOTCONN = 20
|
||||
ISCSI_ERR_NO_OBJS_FOUND = 21
|
||||
const (
|
||||
ISCSI_SUCCESS IscsiAdmReturnValues = 0
|
||||
ISCSI_ERR_SESS_NOT_FOUND = 2
|
||||
ISCSI_ERR_TRANS_TIMEOUT = 8
|
||||
ISCSI_ERR_ISCSID_NOTCONN = 20
|
||||
ISCSI_ERR_NO_OBJS_FOUND = 21
|
||||
)
|
||||
|
||||
func GetISCSIInfo(ctx context.Context, vid *utils.VolumeId, req *csi.NodePublishVolumeRequest, targetIqn string,
|
||||
@@ -92,9 +92,9 @@ func GetISCSIInfo(ctx context.Context, vid *utils.VolumeId, req *csi.NodePublish
|
||||
|
||||
utils.GetLogCTRL(ctx, 5).Println("Final values", "iface", iface, "initiatorName", initiatorName)
|
||||
i := iscsiDisk{
|
||||
VolName: volName,
|
||||
VolName: volName,
|
||||
Portals: bkportal,
|
||||
Iqn: iqn,
|
||||
Iqn: iqn,
|
||||
lun: assignedLunNumber,
|
||||
Iface: iface,
|
||||
chapDiscovery: chapDiscovery,
|
||||
@@ -160,9 +160,9 @@ func GetNodeISCSIInfo(vid *utils.VolumeId, req *csi.NodePublishVolumeRequest, ta
|
||||
}
|
||||
|
||||
i := iscsiDisk{
|
||||
VolName: volName,
|
||||
VolName: volName,
|
||||
Portals: bkportal,
|
||||
Iqn: iqn,
|
||||
Iqn: iqn,
|
||||
lun: assignedLunNumber,
|
||||
Iface: iface,
|
||||
chapDiscovery: chapDiscovery,
|
||||
@@ -180,8 +180,7 @@ func buildISCSIConnector(iscsiInfo *iscsiDisk) *iscsi_lib.Connector {
|
||||
VolumeName: iscsiInfo.VolName,
|
||||
TargetIqn: iscsiInfo.Iqn,
|
||||
TargetPortals: iscsiInfo.Portals,
|
||||
Lun: iscsiInfo.lun,
|
||||
Multipath: len(iscsiInfo.Portals) > 1,
|
||||
Lun: iscsiInfo.lun,
|
||||
}
|
||||
|
||||
if iscsiInfo.sessionSecret != (iscsi_lib.Secrets{}) {
|
||||
@@ -314,10 +313,9 @@ type iscsiDiskUnmounter struct {
|
||||
mounter mount.Interface
|
||||
}
|
||||
|
||||
|
||||
type ISCSIUtil struct{}
|
||||
|
||||
func (util *ISCSIUtil) Rescan (ctx context.Context) (string, error) {
|
||||
func (util *ISCSIUtil) Rescan(ctx context.Context) (string, error) {
|
||||
cmd := exec.Command("iscsiadm", "-m", "session", "--rescan")
|
||||
var stdout bytes.Buffer
|
||||
var iscsiadmError error
|
||||
@@ -337,9 +335,9 @@ func (util *ISCSIUtil) Rescan (ctx context.Context) (string, error) {
|
||||
formattedOutput := strings.Replace(string(stdout.Bytes()), "\n", "", -1)
|
||||
iscsiadmError = fmt.Errorf("iscsiadm error: %s (%s)", formattedOutput, err.Error())
|
||||
}
|
||||
return string(stdout.Bytes()), iscsiadmError
|
||||
}
|
||||
|
||||
return string(stdout.Bytes()), iscsiadmError
|
||||
}
|
||||
|
||||
err = cmd.Wait()
|
||||
if err != nil {
|
||||
exitCode := err.(*exec.ExitError).ExitCode()
|
||||
@@ -459,7 +457,8 @@ func (util *ISCSIUtil) DetachDisk(ctx context.Context, c iscsiDiskUnmounter, tar
|
||||
return err
|
||||
}
|
||||
|
||||
err = iscsi_lib.Disconnect(connector.TargetIqn, connector.TargetPortals)
|
||||
iscsi_lib.Disconnect(connector.TargetIqn, connector.TargetPortals)
|
||||
|
||||
if err := os.RemoveAll(targetPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user