Skip to content

Commit

Permalink
Fix static check failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuchoe committed Sep 18, 2024
1 parent da552e6 commit b14057a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 52 deletions.
2 changes: 1 addition & 1 deletion agent/stats/engine_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func TestStartMetricsPublishForChannelFull(t *testing.T) {
telemetryMessages := make(chan ecstcs.TelemetryMessage, tc.channelSize)
healthMessages := make(chan ecstcs.HealthMessage, tc.channelSize)

engine := NewDockerStatsEngine(&publishMetricsCfg, nil, eventStream("TestStartMetricsPublish"), telemetryMessages, healthMessages)
engine := NewDockerStatsEngine(&publishMetricsCfg, nil, eventStream("TestStartMetricsPublish"), telemetryMessages, healthMessages, nil)
ctx, cancel := context.WithCancel(context.TODO())
engine.ctx = ctx
engine.resolver = resolver
Expand Down
4 changes: 2 additions & 2 deletions ecs-agent/csiclient/csi_client_windows_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestNodeStageVolume(t *testing.T) {
devicePath := "/dev/fake"

// Get metrics for the root volume from EBS CSI Driver.
csiClient := NewCSIClient("C:\\Program Files\\Amazon\\ECS\\ebs-csi-driver\\socket\\csi.sock")
csiClient := NewCSIClient("C:\\ProgramData\\Amazon\\ECS\\ebs-csi-driver\\socket\\csi-driver.sock")
//getVolumeCtx, getVolumeCtxCancel := context.WithTimeout(context.Background(), timeoutDuration)
//defer getVolumeCtxCancel()
var err = csiClient.NodeStageVolume(context.TODO(), volumeID, map[string]string{"devicePath": devicePath},
Expand All @@ -64,7 +64,7 @@ func TestNodeUnstageVolume(t *testing.T) {

targetPath := "C:\\csi_proxy\\mount"
// Get metrics for the root volume from EBS CSI Driver.
csiClient := NewCSIClient("C:\\Program Files\\Amazon\\ECS\\ebs-csi-driver\\socket\\csi.sock")
csiClient := NewCSIClient("C:\\ProgramData\\Amazon\\ECS\\ebs-csi-driver\\socket\\csi-driver.sock")
//getVolumeCtx, getVolumeCtxCancel := context.WithTimeout(context.Background(), timeoutDuration)
//defer getVolumeCtxCancel()
err := csiClient.NodeUnstageVolume(context.TODO(), volumeID, targetPath)
Expand Down
40 changes: 0 additions & 40 deletions ecs-agent/daemonimages/csidriver/driver/mount_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,6 @@ func (m *NodeMounter) MakeDir(path string) error {
return proxyMounter.MakeDir(path)
}

func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error) {
// TODO
return "", 0, errors.New("not supported")
}

func (m NodeMounter) IsCorruptedMnt(err error) bool {
// TODO
return false
}

func (m *NodeMounter) MakeDir(path string) error {
// TODO
return errors.New("not supported")
}

func (m *NodeMounter) MakeFile(path string) error {
// TODO
return errors.New("not supported")
}

func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error) {
// TODO
return false, errors.New("not supported")
}

func (m *NodeMounter) NewResizeFs() (Resizefs, error) {
// TODO
return nil, errors.New("not supported")
}

func (m *NodeMounter) PathExists(path string) (bool, error) {
proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter)
if !ok {
Expand Down Expand Up @@ -224,13 +194,3 @@ func (i *nodeDeviceIdentifier) ListDiskIDs() (map[uint32]*diskapi.DiskIDs, error
}
return response.GetDiskIDs(), nil
}

func (m *NodeMounter) Unpublish(path string) error {
// TODO
return errors.New("not supported")
}

func (m *NodeMounter) Unstage(path string) error {
// TODO
return errors.New("not supported")
}
6 changes: 0 additions & 6 deletions ecs-agent/daemonimages/csidriver/driver/node_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ import (
"github.com/aws/amazon-ecs-agent/ecs-agent/daemonimages/csidriver/mounter"
)

// findDevicePath finds path of device and verifies its existence
func (d *nodeService) findDevicePath(devicePath, volumeID, partition string) (string, error) {
// TODO
return "", errors.New("not supported")
}

// getBlockSizeBytes gets the size of the disk in bytes
func (d *nodeService) getBlockSizeBytes(devicePath string, volumeId string) (int64, error) {
// We need to fetch the device ID based on the devicePath and volumeId. This is needed
Expand Down
4 changes: 2 additions & 2 deletions ecs-agent/daemonimages/csidriver/driver/node_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build windows
// +build windows
//go:build windows && unit
// +build windows,unit

// this file has been modified from its original found in:
// https://github.com/kubernetes-sigs/aws-ebs-csi-driver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"errors"
"testing"

"github.com/aws/amazon-ecs-agent/ecs-agent/daemonimages/csidriver/mounter"

"github.com/golang/mock/gomock"
"github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/mounter"
)

func TestResize(t *testing.T) {
Expand Down

0 comments on commit b14057a

Please sign in to comment.