Skip to content

Commit

Permalink
Fix static check failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuchoe authored and mye956 committed Sep 19, 2024
1 parent aa964dc commit 38e9058
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 60 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
2 changes: 0 additions & 2 deletions ecs-agent/daemonimages/csidriver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/container-storage-interface/spec v1.9.0
github.com/golang/mock v1.6.0
github.com/kubernetes-csi/csi-proxy/client v1.1.3
github.com/kubernetes-sigs/aws-ebs-csi-driver v1.31.0
github.com/stretchr/testify v1.9.0
golang.org/x/sys v0.20.0
google.golang.org/grpc v1.64.0
Expand All @@ -23,7 +22,6 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.1 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
6 changes: 0 additions & 6 deletions ecs-agent/daemonimages/csidriver/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down Expand Up @@ -56,10 +55,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubernetes-csi/csi-proxy/client v1.1.3 h1:FdGU7NtxGhQX2wTfnuscmThG920hq0OaVVpuJW9t2k0=
github.com/kubernetes-csi/csi-proxy/client v1.1.3/go.mod h1:SfK4HVKQdMH5KrffivddAWgX5hl3P5KmnuOTBbDNboU=
github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.1 h1:tVPvlL5N5X598hrO3g9rhyoi6h0LP4RpSJlGHItsbEE=
github.com/kubernetes-csi/csi-proxy/v2 v2.0.0-alpha.1/go.mod h1:pacx+PW7lLlu6kAvpr8Lgq/5fdiAsKxOtXXFHMaLMb8=
github.com/kubernetes-sigs/aws-ebs-csi-driver v1.31.0 h1:4KeDwl2hfuFosBD5qizEho9GaFkBF2aLDwrjYVeszEk=
github.com/kubernetes-sigs/aws-ebs-csi-driver v1.31.0/go.mod h1:48fhyk7k7jt0y6wYjxcl7XypG9sZi+vv0tyv3d1E6lg=
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -182,7 +177,6 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U=
k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/mount-utils v0.30.1 h1:4HEFqo2bzRjCHHXRu7yQh6tvpMnplwWaqhuU7oE3710=
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 38e9058

Please sign in to comment.