Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 0 additions & 251 deletions build/lib/csiplugin-connector.go

This file was deleted.

13 changes: 0 additions & 13 deletions build/lib/csiplugin-connector.service

This file was deleted.

35 changes: 0 additions & 35 deletions pkg/mounter/connector_mounter.go

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/nas/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ func (m *NasMounter) Mount(source string, target string, fstype string, options
return err
}

func newNasMounter() mountutils.Interface {
inner := mountutils.NewWithoutSystemd("")
return &NasMounter{
Interface: inner,
alinasMounter: mounter.NewConnectorMounter(inner, ""),
}
}

func newNasMounterWithProxy(socketPath string) mountutils.Interface {
inner := mountutils.NewWithoutSystemd("")
return &NasMounter{
Expand Down
5 changes: 0 additions & 5 deletions pkg/nas/mounter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ func (m *errorMockMounter) Mount(source string, target string, fstype string, op
return errors.New("")
}

func TestNewNasMounter(t *testing.T) {
actual := newNasMounter()
assert.NotNil(t, actual)
}

func TestNasMounter_MountSuccess(t *testing.T) {
nasMounter := &NasMounter{
Interface: &successMockMounter{},
Expand Down
8 changes: 2 additions & 6 deletions pkg/nas/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ func newNodeServer(config *internal.NodeConfig) *nodeServer {
NodeID: config.NodeName,
},
}
if config.MountProxySocket == "" {
ns.mounter = newNasMounter()
} else {
ns.recorder = utils.NewEventRecorder()
ns.mounter = newNasMounterWithProxy(config.MountProxySocket)
}
ns.recorder = utils.NewEventRecorder()
ns.mounter = newNasMounterWithProxy(config.MountProxySocket)
return ns
}

Expand Down
28 changes: 0 additions & 28 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"errors"
"fmt"
"io"
"net"

Check failure on line 26 in pkg/utils/util.go

View workflow job for this annotation

GitHub Actions / lint

"net" imported and not used) (typecheck)

Check failure on line 26 in pkg/utils/util.go

View workflow job for this annotation

GitHub Actions / lint

"net" imported and not used) (typecheck)

Check failure on line 26 in pkg/utils/util.go

View workflow job for this annotation

GitHub Actions / lint

"net" imported and not used) (typecheck)

Check failure on line 26 in pkg/utils/util.go

View workflow job for this annotation

GitHub Actions / lint

"net" imported and not used) (typecheck)
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -83,8 +83,6 @@
fsckErrorsCorrected = 1
// fsckErrorsUncorrected tag
fsckErrorsUncorrected = 4
// socketPath is path of connector sock
socketPath = "/host/run/csi-tool/connector/connector.sock"

// GiB ...
GiB = 1024 * 1024 * 1024
Expand Down Expand Up @@ -530,32 +528,6 @@
return ""
}

// ConnectorRun Run shell command with host connector
// host connector is daemon running in host.
func ConnectorRun(cmd ...string) (string, error) {
c, err := net.Dial("unix", socketPath)
if err != nil {
klog.Errorf("Oss connector Dial error: %s", err.Error())
return err.Error(), err
}
defer c.Close()

_, err = c.Write([]byte(strings.Join(cmd, "\x00")))
if err != nil {
klog.Errorf("Oss connector write error: %s", err.Error())
return err.Error(), err
}

buf := make([]byte, 2048)
n, _ := c.Read(buf[:])
response := string(buf[0:n])
if strings.HasPrefix(response, "Success") {
respstr := response[8:]
return respstr, nil
}
return response, errors.New("Exec command error:" + response)
}

// AppendJSONData append map data to json file.
func AppendJSONData(dataFilePath string, appData map[string]string) error {
curData, err := LoadJSONData(dataFilePath)
Expand Down
Loading