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

Support osversion when selecting base images #536

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Dec 13, 2021

Fixes #534

This builds on #533 to add an option to the --platform flag to explicitly select a platform by osversion, which happens to be necessary to select the correct golang:1.17 base image for the GitHub Actions runner environment.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #536 (606c4c7) into main (2ba70fc) will decrease coverage by 0.04%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #536      +/-   ##
==========================================
- Coverage   48.16%   48.12%   -0.05%     
==========================================
  Files          42       42              
  Lines        2182     2184       +2     
==========================================
  Hits         1051     1051              
- Misses        954      955       +1     
- Partials      177      178       +1     
Impacted Files Coverage Δ
pkg/commands/config.go 56.25% <62.50%> (-1.13%) ⬇️
pkg/commands/resolver.go 31.55% <66.66%> (-0.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ba70fc...606c4c7. Read the comment docs.

@imjasonh
Copy link
Member Author

imjasonh commented Dec 14, 2021

Experimenting with the platform syntax used in https://github.com/estesp/mquery where platform is os[/arch[/variant]][:osversion], which would allows us to 1.) get away without a new flag 🎉 , and 2.) allow specifying multiple different osversions in --platform 🎉 🎉

This works:

$ go run ./ build ./ --platform=windows/amd64:10.0.17763.2300
...
gcr.io/imjasonh/ko-98b8c7facdad74510a7cae0cd368eb4e@sha256:65977075f677a3ead974261f523d8ffff894074695e5b65b13ff9d19a820cc66

This currently panicks:

$ go run ./ build ./ --platform=windows/amd64:10.0.17763.2300,windows/amd64:10.0.14393.4770
<snip, see https://github.com/google/ko/issues/544>

I'll work on figuring that out while we decide if we like this syntax.

If we go with this format we should probably also get crane to use it, and drop its --osversion flag too.

@imjasonh
Copy link
Member Author

imjasonh commented Dec 14, 2021

Hey, good news, this isn't a new panic introduced by this PR 😅 #544

@imjasonh imjasonh changed the title Add --osversion to select a base image Support osversion when selecting base images Dec 14, 2021
Use this in e2e tests.

Also clean up usage of bo.Platform vs a new platform var.
@imjasonh
Copy link
Member Author

Any more concerns with this?

@imjasonh imjasonh merged commit 33fa766 into ko-build:main Dec 15, 2021
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.

ko needs an --osversion flag
3 participants