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

feat: --platform flag #380

Merged

Conversation

coopernetes
Copy link
Contributor

@coopernetes coopernetes commented Oct 6, 2023

  • for images under test, pass the new --platform flag to pull the
    corresponding image if it is multi-platform capable
  • test execution via CreateContainerOptions passes in platform. If
    unset, will default to linux/$GOARCH

Related: #373

This required a small enhancement from go-dockerclient via fsouza/go-dockerclient#1017. Updated go.mod was grabbed from the latest commit.

TODO:

  • test case for --pull with --platform specified
  • test case for executing tests against a non-default image
  • fix formating
  • update documentation

@loosebazooka
Copy link
Member

looks good to me, I think there's some minor formatting issues?

@coopernetes
Copy link
Contributor Author

looks good to me, I think there's some minor formatting issues?

Good catch, should be fixed up now with gofmt -w.

@coopernetes coopernetes force-pushed the feat/multi-platform branch 2 times, most recently from 88b64a3 to 20e1fc8 Compare October 15, 2023 01:57
@loosebazooka
Copy link
Member

podman's been super flaky, I can't get it to startup properly, but hopefully #385 should fix that and you can rebase on that.

@loosebazooka
Copy link
Member

Can we rebase now? And pull in that macos ci update

- for images under test, pass the new --platform flag to pull the
  corresponding image if it is multi-platform capable
- test execution via CreateContainerOptions passes in platform. If
  unset, will default to linux/amd64
gofmt tidy

specify correct folder for platform tests
MacOS cannot run containers natively. M1/M2 defaults to linux/arm64 so
the "os" field as part of --platform only needs to use linux/ as a
default with GOARCH read in for the particular CPU architecture. Same
deal with Windows, Docker on windows is virtualized Linux (AFAIU)
@coopernetes
Copy link
Contributor Author

Rebased, tests are passing again. @loosebazooka let me know if any other changes are needed.

@loosebazooka loosebazooka merged commit 0db4700 into GoogleContainerTools:main Oct 18, 2023
3 checks passed
@coopernetes
Copy link
Contributor Author

This closed #373

@coopernetes coopernetes deleted the feat/multi-platform branch October 27, 2023 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants