kubernetes-sigs / aws-ebs-csi-driver

CSI driver for Amazon EBS https://aws.amazon.com/ebs/
Apache License 2.0
961 stars 778 forks source link

Project does not build when GOOS=darwin #1556

Open wmedlar opened 1 year ago

wmedlar commented 1 year ago

/kind bug

What happened?

The project does not compile on MacOS / darwin because there is no code to implement the necessary nodeService methods like there is for Linux and Windows.

What you expected to happen?

Code compiles well enough to run e2e tests.

How to reproduce it (as minimally and precisely as possible)?

$ GOOS=darwin go build -o bin/aws-ebs-csi-driver ./cmd/
# github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/driver
pkg/driver/mount.go:63:9: cannot use &NodeMounter{…} (value of type *NodeMounter) as Mounter value in return statement: *NodeMounter does not implement Mounter (missing method GetDeviceNameFromMount)
pkg/driver/node.go:190:19: d.findDevicePath undefined (type *nodeService has no field or method findDevicePath)
pkg/driver/node.go:340:21: d.IsBlockDevice undefined (type *nodeService has no field or method IsBlockDevice)
pkg/driver/node.go:346:19: d.getBlockSizeBytes undefined (type *nodeService has no field or method getBlockSizeBytes)
pkg/driver/node.go:360:23: d.findDevicePath undefined (type *nodeService has no field or method findDevicePath)
pkg/driver/node.go:375:17: d.getBlockSizeBytes undefined (type *nodeService has no field or method getBlockSizeBytes)
pkg/driver/node.go:480:20: d.IsBlockDevice undefined (type *nodeService has no field or method IsBlockDevice)
pkg/driver/node.go:486:23: d.getBlockSizeBytes undefined (type *nodeService has no field or method getBlockSizeBytes)
pkg/driver/node.go:592:19: d.findDevicePath undefined (type *nodeService has no field or method findDevicePath)
pkg/driver/node.go:697:14: d.preparePublishTarget undefined (type *nodeService has no field or method preparePublishTarget)
pkg/driver/node.go:697:14: too many errors

Anything else we need to know?:

I don't actually want to run the driver on MacOS, but I do want to run e2e tests to validate my installation of the driver. Currently I can work around this by running the tests in a container.

Environment

wmedlar commented 1 year ago

796 is related, but was closed without any changes being made.

ConnorJC3 commented 1 year ago

Hi, building for Darwin is intentionally not supported, as the EBS CSI Driver cannot run on Darwin. Building for Darwin should not be required to run the e2e tests (you will need to build for Linux, as the e2e tests must be run on a real cluster on AWS).

wmedlar commented 1 year ago

The e2e tests import code from the driver, which is why building on darwin is required. The driver itself and the resources created by the tests are all run in a real cluster. Like I mentioned in the original post, I don't have any interest in running the driver on darwin. I should, however, be able to run the e2e tests from my laptop without having to jump through hoops.

A stub implementation of the nodeService would be plenty fine, as would a clean separation between the application code and the e2e tests.

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

AndrewSirenko commented 6 months ago

/remove-lifecycle rotten

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

AndrewSirenko commented 1 month ago

/remove-lifecycle rotten