Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packer_hello_world_example_test.go fails on Apple Silicon #1310

Open
fex01 opened this issue Jun 17, 2023 · 0 comments
Open

packer_hello_world_example_test.go fails on Apple Silicon #1310

fex01 opened this issue Jun 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@fex01
Copy link

fex01 commented Jun 17, 2023

The "Hello World" Packer example and matching test "packer_hello_world_example_test.go" fail if the host plattform is not linux/amd64. The cause is easy to determine - the example does use the image gruntwork/ubuntu-test:16.04, which is only available for amd64-platforms. Such running the test will first result in the warning WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested before the expected text "Hello, World!" is returned, resulting in a failed test:

TestPackerHelloWorldExample 2023-06-17T08:59:45Z logger.go:66: Running command docker with args [run gruntwork/packer-hello-world-example cat /test.txt]
TestPackerHelloWorldExample 2023-06-17T08:59:45Z logger.go:66: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
TestPackerHelloWorldExample 2023-06-17T08:59:45Z logger.go:66: Hello, World!
    packer_hello_world_example_test.go:23: 
                Error Trace:    /workspaces/ws-cdktf-python/terratest/test/packer_hello_world_example_test.go:23
                Error:          Not equal: 
                                expected: "Hello, World!"
                                actual  : "WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested\nHello, World!"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1,2 @@
                                +WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
                                 Hello, World!
                Test:           TestPackerHelloWorldExample
--- FAIL: TestPackerHelloWorldExample (5.09s)
FAIL
exit status 1
FAIL    github.com/gruntwork-io/terraform-basic-example 5.110s

Leaving aside the question if the example should be updated to fix the problem - how would that problem be handled in a real world scenario? Exchange the base image for an image supporting multi-platform builds? Could the test be updated in a way to except the warning and such be succefull both on amd64 and arm64 hosts? Could we somehow suppress the warning? Any other advise?

@denis256 denis256 added the bug Something isn't working label Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants